Editing hosts file on Windows 8

I'm trying to edit my hosts file in Windows 8 Pro.

When I open C:\Windows\System32\Drivers\etc\hosts in Notepad++ or any other text editor, make changes and attempt to save, I get a dialog that tells me "Save failed: Please check if this file is opened in another program."

I can't think of what would be using it (other than a browser, IIS, and Windows Defender). I've never encountered this problem in Windows 7. I have used Process Explorer to try and identify any processes that are currently using the hosts file, but when I search Process Explorer for the "Handle or DLL substring" 'hosts' it doesn't return anything. I've looked around Process Explorer to see if there is any other way to search for processes consuming the file, but haven't had any luck.

I've also tried simply stopping the Windows Defender service and stopping the WWW Service.


You have to run Notepad++ as administrator. Otherwise you won't have the neccessary permissions to edit that file.


If you actually have administrator rights, then you're probably fighting against UAC. Make sure to launch your favorite text editor by right-clicking on it and selecting "Run as administrator".


I had the same case, and couldn't change the hosts file even after I checked if I had all the permissions in the user settings or the hosts file's permissions.

ANSWER: Some antivirus software (in my case AVIRA)blocks everything in changing hosts files in their security options. Disable it for a minute, and change. Be careful, it can be risky!


You may also want to check your permissions on the host file itself. You may run as administrator but you may not have the rights to edit the file.


Copy the hosts file to another location on the PC (like Documents) and edit in that location. copy hosts file back to original location. Worked for me.