How to Delete Jpeg files when runnig Process

I tried everything but unfortunately not successful. System saying we can not delete file while runnig process. Could you help any ideas ? Or how can i save some jpeg files in temprorary variable? So my project is like this i have for loop .In every loop, my loop downloading two jpeg files.For the next loop i should delete file or overwrite if it possible.

@Palaniyappan please help me this question urgently , thanks for advance


Can you share your workflow screenshot and also error you are getting?


: The process cannot access the file ‘2021-04-23T10 27 26.jpeg’ because it is being used by another process.

@Forum_Staff Guys can you help me please , how to solve such kind of problem ?


I also had the same issue, but as a work around can you write the path of the file which you need to delete and when you start the process 2nd time you can delete and proceed to next steps

Hope this may help you


My first reaction is that you have a lot of nested activities there. It’s hard to tell what is happening there but you may check in the Computer Management what is using your file when this error appears. If it is the Studio then it must be something in your process that keeps this file.

Do you have the image open? Is another program accessing it? Basically this error means something else is using the file and you can’t delete it. Just like if you open a spreadsheet in Excel then try to delete the file.

I have two Ocr(Omni,Microsoft) activities.They are not allowing delete image file .After parsing photo. So how i can solve this problem.As you said i did but unfortunately not successful.So about my project i have website where data scraping then I use for each : if we have some clients. We are with loop one by one client downloading two image files,after service first clinet and parsing photo.I should make folder empty.But when i am deleting i have problem file being used by another process

I have an automation that processes scanned image files and reads the content using OCR. Any scans that are successfully read are to be deleted so the automation stores their file paths.

At the end of the automation the files are deleted one by one using a For Each activity however the deletion of the last file in the list always fails due to it being used by another process.

I have tried to put in some artificial delays just before the delete portion of the automation but to no avail.

I have also tried moving the files instead of deleteing them but the lock is still blocking the action.

I have also tried adding invoke methods to force garbage collect and WaitForPendingFinalizers after the Load Image and OCR activites and before the Move File activity.