Access denied to delete folder

I cant get access to delete files in c:\windows\temp ? any idea how to get full access for the uipath ?

Hi @nibu

Go to that folder and right click and get to its properties. There go to security and check what permissions you have for the folder. Under permissions give full control for the user and apply it. It will work for you as it seems you don’t have full access to the folder.

Hi
May i know which version you are using
Kindly uninstall the current version and use the new version of uipath
Cheers @nibu

Hi Palan,
The version i am using uipath is community Edition 2019.7.0

I am running uipath with admin access but still get access denied.

Hi @nibu

Just a trial and error did you try to delete it manually ? If you cannot also delete you a have a permission access problem is that make sense ?

cheers :smiley:

Happy learning :smiley:

your right I have permission issues .

2 Likes

Yep. You can change the access level to full access as I explained in my previous post. If it’s your office PC you may require their assistance in getting permission setup…

The robot can delete many folder however it stuck on access denied or files are used by other programs.
How can I skip the file which are access denied and continue the process of deleting ?

Use a try catch activity. Place the delete activity within the Try segment. Then if it runs into an error, it will get to the catch part. THere you can try adding some logs about the error and continue with the process.

Thank you and why do the whole folder get delete ? I want to delete files inside the folder ?

In the delete activity, you have to give the exact file path along with the file name and the extension to delete the file. If the file name is not included, the folder will be deleted

1 Like

There is many different files extension temporary files in the A folder , how can i do general path to trigger folder A to wipe all the files ?

I would suggest… to get all the file paths in that folder to a string array first.
You an do it by
Directory.GetFiles(FilePath)

Then, loop through the array using a For Each loop.
Within the loop, you can include the delete activity to delete each file.

1 Like

Can you share sample project ?

Hi @nibu

Sorry for the late reply. Here is the sample file for the delete scenario I just explained above

DeleteFiles.xaml (5.3 KB)

Many thanks @Lahiru.Fernando

This works by deleting files with extension and leave behind subfolders ? do you have one wipe everything inside a folder ?

1 Like

@nibu

I changed the workflow a bit. So this will first check for all the files inside a particular folder. Then it will get a full list of all the sub folders in it. The two results will be merged into one list of string so that one loop can be used to delete them all…

DeleteFiles.xaml (6.7 KB)

1 Like

The example is perfect and many thanks for your help @Lahiru.Fernando

1 Like

HI @nibu

Sorry for my late reply. Was busy with some deployment work.

Glad to know that I was able to help you out :slight_smile:
If my answer helped you to get your problem fixed, could you also please mark the answer as the solution too :slight_smile:

Thank you and happy automating!

2 Likes