How to Edit Files That Require Admin Privileges

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.

Play ;

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.

Amit Agarwal is a web geek, solo entrepreneur and loves making things on the Internet. Google recently awarded him the Google Developer Expert and Google Cloud Champion title for his work on Google Workspace and Google Apps Script.

Awards & Recognition

Google Developer Expert

Google Developer Expert

Google awarded us the Developer Expert title recogizing our work in Workspace

ProductHunt Golden Kitty

ProductHunt Golden Kitty

Our Gmail tool won the Lifehack of the Year award at ProductHunt Golden Kitty Awards

Microsoft MVP Alumni

Microsoft MVP Alumni

Microsoft awarded us the Most Valuable Professional title for 5 years in a row

Google Cloud Champion

Google Cloud Champion

Google awarded us the Champion Innovator award for technical expertise

Want to stay up to date?
Sign up for our email newsletter.

We will never send any spam emails. Promise 🫶🏻