I have a problem saving a config file in the Program Files folder. I am getting an "Access to the path ... is denied" fault.

I am member of the Administrators group. The Administrators group has "Full control" on the folder containing the config file and the "Program Files" folder. The User Account Control (UAC) is set to "Never notify".

Windows 8 is installed.

I can make changes to file in when I run notepad as administrator. But that's not really an option to edit every file in the Program Files folder as administrator.

Can anyone please help me out here?

migrated from serverfault.com Oct 30 '12 at 5:47

This question came from our site for system and network administrators.


Even though you are in the administrators group with UAC off, you must still opt manually to "run as administrator" at the time when you start your app, or your process will only have standard user rights. You might try changing the permissions for your app's folder (or even just that one file) to give write access to standard users, and see if that helps.


Who has ownership?

Try taking ownership of the file.

Open command prompt as an administrator. Type:

takeown /f "%filePath%"
icacls "%filePath%" /grant Everyone:F

Replace %filePath% with the path of the file.

Alternatively, you can change ownership using the GUI:

  • Right click on the file > Properties > Security > Advanced > For "Owner:", click "Change" > Advanced... > Find Now > Everyone > OK > OK > OK > OK.

Using the GUI, you can also check advanced permissions and inheritance. Make sure those are correct.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.