Hi,
Can someone suggest how to force delete a file from a shared folder if it is being used by another user who has access to the same shared folder.
Hi,
Can someone suggest how to force delete a file from a shared folder if it is being used by another user who has access to the same shared folder.
Use Kill process activity.This activity kills the Process which is used by another User.
or
If you want to delete the file use File exists activity.If it is true then use Delete File activity.
@rlgandu I am using a VM for my bot to run. Kill process kills the excel in my Machine. The file is accessed by another user in another machine .
If you want to delete the file use File exists activity.If it is true then use Delete File activity.
So is there a option to force delete the file from the folder . ?
I used the delete file still its showing used by another process.
You can use Kill Process activity and in activities you can give All so that it will kill the excel for all users.
Regards
You cannot force delete the file which are using by other user. The error message “The process cannot access the file because it is being used by another process” typically indicates that a file is locked or in use by another user or process, preventing your process (UiPath automation) from accessing or modifying it. This error is not directly related to UiPath but is a general Windows file system error. other process or other user have access to read only but not able to modify or delete it.
Then there is no other ways to delete the already using file. Bot has to wait untill the file available to delete, then delete the file in shared folder.
Hope it helps!!
Instead of deleting the File when another user accessing the shared folder file change the Permissions of file which users have the access to use that file.By making it as password protected
The consumer of the file should have read only access to avoid this error.
Thanks,
Ashok
Thanks @ashokkarale for this solution as you said it was related to file configuration
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.