PDA

View Full Version : Access denied to edit file on Windows 7



samnorr
07-07-2009, 01:33 PM
Put simply, I am trying to follow this (http://www.mediacollege.com/microsoft/windows/media-center/new-zealand.html) guide to modify an XML file in Windows 7.

I can open the file fine, but I keep getting an "access denied" message when I attempt to save it. I am logged on as an administrator.

Is there some setting that protects OS files in Windows 7?

Blam
07-07-2009, 03:36 PM
You'll need to take ownership of it first.

In start menu type cmd and right click>run as admin

Then type these commands hitting enter after each:

takeown /f PATH OF FILE /d y
icacls PATH OF FILE /grant administrators:F

Blam

samnorr
07-07-2009, 07:39 PM
I just thought to try editing the file in XP (which I have on another partition), and it let me save it with no problems - so problem solved.

I did already try what you said above blam6, but it didn't work - I got the same "access is denied" message (in Notepad, Wordpad and Visual C#) . So I still don't actually know what was wrong. :confused:

wainuitech
07-07-2009, 08:35 PM
I just thought to try editing the file in XP (which I have on another partition), and it let me save it with no problems - so problem solved.

I did already try what you said above blam6, but it didn't work - I got the same "access is denied" message (in Notepad, Wordpad and Visual C#) . So I still don't actually know what was wrong. :confused: Could be the fact that you are not actually the "Real Administrator".

Your account may have admin rights but its not the "real Admin Account" , and the "take ownership" doesn't always work either.

To access the real admin account Have a read of this (http://www.mydigitallife.info/2007/08/10/activate-enable-and-show-administrator-account-in-vista-welcome-screen/) you dont need the password section.( skip step #4) then to hide it again, do the same, but change the "yes" to No.

Changing to the "Real" admin account may allow you to alter the file.