How to Edit Files That Require Admin Privileges

There are certain files and folders (like the hosts file in Windows System32 folder) that you can only open /edit if you are logged in as the administrator of that computer.

August 26, 2013

There are certain files and folders in Windows that you can only access when you are logged in as the administrator of that computer.

For instance, if you ever need to block a website on your home computer through the hosts file, your would require administrative privileges. Similarly, you may not be able to execute all the commands at the command prompt if you not logged in as the admin.

File Permission Error

Sometimes Administrators Cannot Edit Files

There’s another related problem that mostly concerns the home consumers of Windows 7 and Vista.

Sometimes you are the admin (and the only user) of your home computer and yet, when you try to open some protected file, it says “access denied”. This is confusing because you are logged in as the super-user and if you don’t have access to all parts of the system, who else will?

The fix is simple though. I will illustrate this with Windows hosts file but you can apply the workaround to virtually all files that you are unable to read / edit in Windows because of permission problems.

Step 1. Open your Windows start menu, search for the notepad application and then right click the notepad icon.

Step 2. Choose “Run as administrator” and then, while inside notepad, browse to folder (/windows/system32/drivers/etc) that contains the hosts file.

You can now edit and save that file in the same folder without any issues. To recap, 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.