Edit Files that Require Admin Privileges Easily

by on May 21st, 2010

Some files and folders can only be accessed in Windows when you are logged in as an administrator. Sometimes a file you just edited, saved and closed using some software won’t reopen or will not be deleted if you are done working with it. In this case there is an easy solution to re-edit that file. Similarly if you need to edit hosts file located at c:\WINDOWS\system32\drivers\etc\hosts to block or unblock websites you need administrator level privileges to edit this file.

Sometimes as an administrator when you try to open some protected file, it says “access denied”. This is confusing because you are logged in as the administrator and if you don’t have access to all files of your system, who else will? The fix is simple.

  • Open notepad as an Administrator
  • To do that go to Start menu and search for the notepad application and then right click the notepad icon
  • Choose “Run as administrator”
  • Inside notepad, Click File > Open > browse to file which needs to be edited
  • You can now edit and save that file without any issues

The trick is that instead of directly opening a protected file in the associated application, you run the application first as an administrator and then open the file inside it.