Skip to main content
July 25, 2025
Question

RPA -Throwing error Caused by: java.io.IOException: Failed to delete original file 'C:\\Users\\user\\Downloads\\xyz.zip' after copy to 'C:\\Users\\user\\RPA\\Executed Files\\xyz.zip'

  • July 25, 2025
  • 5 replies
  • 0 views

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

5 replies

shubhama926776
July 25, 2025

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. 

July 28, 2025

Thank you for the response [mention:9861aef97eb2483a8b76175d9eda1e37:e9ed411860ed4f2ba0265705b8793d05]  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

shubhama926776
July 28, 2025

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.