31
9
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.
Don't overlook excluding hosts file from Windows Defender, amongst any other AV programs installed, before attempting to modify it following the advice here. See here for further instructions; http://www.howtogeek.com/122404/how-to-block-websites-in-windows-8s-hosts-file/
– None – 2014-07-06T08:09:19.223Related: hosts file ignored, how to troubleshoot? on Server Fault.
– Arjan – 2015-06-21T13:46:44.160-1 You write that you get this error in any text editor "Save failed: Please check if this file is opened in another program" <-- I do not believe you. I google that and from the results i've seen, only notepad++ comes up – barlop – 2015-07-24T08:43:10.420
1Process Explorer itself has been known to sometimes keep a file open. Also make sure you run notepad As Administrator. I've had no issues editing hosts file in win8. – Bret Fisher – 2012-09-18T16:17:44.117
2Running as Administrator was the answer, Thanks Bret. – None – 2012-09-18T16:27:02.263