Earlier today, I tried modifying the hosts file of a Windows 7 PC but the file won't save after modification. It keeps showing a "failed save" error message that keeps telling me to check if the file is opened in another program.
I googled it and fortunately stumbled on a trick on Microsoft website that worked for me. So, I decided to share it with you.
To fix this issue, follow these steps:
==> Click Start Start button , click "All Programs:, click "Accessories", right-click "Notepad", and then click "Run as administrator".
If you are prompted for an administrator password or for a confirmation, type the password, or click Allow or Yes.
==> Open the Hosts file, make the necessary changes, and then click "Save" on the Edit menu. If using Windows 7, you will need to click "Save" on the File menu.
Kindly note that this issue occurs even though you log on by using an account that has administrative credentials.
I also read here that you might also have to disable your Antivirus.
I hope this helps.
NB: To access the hosts file, go to : C > Windows > System32 > drivers > etc