When I am running RPA it is failing and saying it is failed to delete the file after copying it to the given location. Please help me with the possible cause and fix
Discussion posts and replies are publicly visible
The error occurs because the ZIP file is still locked after copying. Add a 1-2 second delay after the copy operation before attempting to delete - this usually fixes it. If not, change your approach to use a "move" operation instead of "copy then delete" which is more reliable. Alternatively, implement retry logic that attempts deletion 3 times with delays between attempts. Also check if antivirus is scanning the file and ensure the RPA bot has proper delete permissions on the Downloads folder.
Thank you for the response Shubham Aware I am using move file or folder to final location file system action.
Which throws the manage exception and produce this error but will try to reconfigure the way you are suggesting. Could you please suggest what could be the possible issue that above file system action is failing
The “move file or folder” action often fails because the file is locked by another process (like antivirus or an open app), there are permission issues, the destination already has a file with the same name, or the RPA agent isn’t fully connected.Ensure no process is using the file, check permissions, confirm destination path is correct and empty, add a short delay after previous file operations, properly close all streams, and verify the RPA agent is running.
I think the main cause is file is locked by another previous action itself we have tried to increase the pause to 1800 seconds which worked once but since then it is failing. What if we do the file deletion manually or perhaps there can be a need to redesign it from the begining it self-
Here is the process -1 Download zip file from browser
2. Take out 1 relevant file from the zip and then move it to a location from where it will be picked up another process
3. Final step to delete the file from the downloads and move it to executed files for RPA folder
Please let me know what can be best way to achieve this
Thank you so much for your time!! It's a bit difficult to understand about RPA possible errors but discussion really help a lot.
Good to hear that,When you extract files from the zip in step 2, the extraction process locks the zip file and doesn't properly release it, preventing the move operation in step 3. The best fix is to redesign your process to work with copies instead: download the zip, then copy (not move) it to a temporary working folder, extract the needed file from this copy, move the extracted file to its destination, delete the temporary copy, and finally move the original zip from Downloads to Executed Files. This works because you're extracting from a copy, leaving the original file unlocked and free to move. If you can't redesign the process.