Move File Activity: Access to the path is denied


I have ran into this issue when trying to run my automation on a VM. The process opens an excel file if there is one available, then collects data from that document and makes queue items, and then at the very end the file in that folder it was processing is moved to another folder. The error comes at the very end where it tries to move the file from the folder the bot picked it up in to the folder that holds the completed files.

I am able to go into this folder with no issues when I remote into the VM and the folder that it says is access denied is located in the same folder as the first folder it is able to access no problem. I have tried a ton of things, changing the folder location, editing the folder permissions to allow access to everyone, and no matter what I try, it has always told me access denied.

Error Message:

Access to the path is denied.

at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.__Error.WinIOError()
at System.IO.File.InternalMove(String sourceFileName, String destFileName, Boolean checkHost)
at UiPath.Core.Activities.MoveFile.Execute(CodeActivityContext context)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at UiPath.Executor.BaseRunner.EndExecute(IAsyncResult result)
at UiPath.Executor.InProcessRunner.EndExecute(IAsyncResult result)
at UiPath.Core.Activities.ExecutorInvokeActivity.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

If anyone has experienced this issue and has a solution that would be greatly appreciated.


Are you closing Excel before trying to move the file?

Yes, when I run this on my local machine I have no issues, just when trying to run from UiPath Assistant in the VM.

How are you closing Excel?

Hey Paul, I was able to solve this, I found out that UiPath automatically blocks folders that contained published projects. Before I had all my folders for processing in one place and kept the projects there for back up. I moved the folders that are used for processing outside of that folder and into a new one that did not contained published project files and it no longer had the ‘Access to the path is denied’ errors.

Thank you for your help!