Why do I need administrator privileges to access files in AppData (on Vista)?

My application (vb.net) sometimes throws a "denied access" exception when trying to delete files in the AppData folder, and I'm not sure why.

I confirm that the file exists before trying to delete it, and did nothing to make it read-only, etc.

Interestingly, everything seems to be in order when I logged in with administrator privileges. However, I thought the AppData folder did not require administrator rights.

Any help would be greatly appreciated!

Thanks!

+4
source share
4 answers

My gut instincts, without seeing your code, it may be that you opened this file in your program or in another program?

+5
source

Perhaps these files were created when you launched the application registered as Admin? Thus, you get this error when you try to delete them later as a regular user.

+4
source

This is not necessarily a folder, but the owner of the file you are trying to interact with. If the file belongs to the Administrators, you may have problems.

+4
source

AppData is a secure hidden folder because it is designed for your Local, LocalLow, and Roaming data storage applications. This is why you will be prompted for a UAC when trying to enter a folder, and also hidden from view.

Try using the Privilege request attribute in your code to request the height of the process for accessing the folder.

+1
source

All Articles