Windows Hosts file: You don’t have permission to save in this location

Symptom

You are editing the hosts (or services file) and trying to save the file. Unfortunately, you are getting permission denied error while saving the hosts (or services file).

C:\Windows\System32\drivers\etc\hosts
You don’t have permission to save in this location. Contact the administrator to obtain permission.

Hosts - Save as permission error

Solution

1. Open a new notepad by right clicking on it and select Run as Administrator. *Below screenshot is the example to run a program as administrator.

Windows - Run as Administrator

2. Copy all the contents from the original hosts file (please make a copy of backup first) and paste them inside the new notepad.

3. Add the new item you required inside the new notepad. Now save the hosts file in the C:\Windows\System32\drivers\etc directory, use hosts as the filename and select Save as type to All Files. Just accept Yes to replace the old hosts file.

Hosts - Save new file

Note

The same step was done for services file.

You May Also Like

Leave a Reply?