Windows Legacy OS forum

General discussion

C:\WINDOWS\system32\drivers\etc\hosts file cannot saved..

by nasieza / July 26, 2009 6:03 PM PDT

please help me..

I want to include a new IP data to system32\hosts but I can't to save the changing.

The error is ...

"Cannot create the C:\WINDOWS\system32\drivers\etc\hosts file. Make sure that the path and filename are correct"

Discussion is locked
You are posting a reply to: C:\WINDOWS\system32\drivers\etc\hosts file cannot saved..
The posting of advertisements, profanity, or personal attacks is prohibited. Please refer to our CNET Forums policies for details. All submitted content is subject to our Terms of Use.
Track this discussion and email me when there are updates

If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.

You are reporting the following post: C:\WINDOWS\system32\drivers\etc\hosts file cannot saved..
This post has been flagged and will be reviewed by our staff. Thank you for helping us maintain CNET's great community.
Sorry, there was a problem flagging this post. Please try again now or at a later time.
If you believe this post is offensive or violates the CNET Forums' Usage policies, you can report it below (this will not automatically remove the post). Once reported, our moderators will be notified and the post will be reviewed.
Collapse -
How are you creating this Hosts file?
by MarkFlax Forum moderator / July 26, 2009 8:47 PM PDT

The way I do it.

Navigate to C:\WINDOWS\system32\drivers\etc\hosts and open the file with Notepad, (Right click, select Notepad and make sure that the option to "Always use this application to open this type of file" is NOT selected).

I make the change, then goto File > Save As, ensure the "Save as file type:" is All files and not *.txt , then click Save. Accept the warning that this will overwrite the existing file.

Does that not work for you?


Collapse -
Follow these steps
by itsolutioners / October 1, 2009 11:54 AM PDT

1. Click on Start Button
2. Rt. click on 'Notepad'
3. Click "Run As Administrator"
4. Click "Continue" on the prompt
5. Navigate to C:\Windows\System32\drivers\etc\ using Notepad's 'Open' location option.
6. Select 'all files' and then choose the 'hosts' file. Make necessary changes and save!

Collapse -
If the previous suggestions do not work it is ...
by Edward ODaniel / October 2, 2009 5:01 AM PDT

entirely possible that your user account does not have the necessary permissions to write to the directory or it is also possible that you have something like SpyBot running that you have configured to "secure" the hosts file which it does by making it read only.

You can check the file properties to see if it is read only and you can check the file and etc folder properties security tab to see what permissions you have. (If you hav4e XP Home you will need to boot to the ADMINISTRATOR account in Safe Mode to see the Security tab)

Collapse -
simple way..
by casper202 / March 28, 2010 2:34 PM PDT

even easier... simply open good old DOS and use the type command with a pre-written text file and redirection.. eg type file.txt >> hosts -- be sure to use 2 ">" or you will overwrite the file.
from my experience with the system you just need to be a member of admin group.. no need for safe-mode etc..

Collapse -
Easier way is in the eye of the beholder
by Edward ODaniel / March 29, 2010 3:46 AM PDT
In reply to: simple way..

A much "easier way" than your suggesion would be to use EDIT.COM or even EDLIN.EXE to alter the HOSTS file or if you are familiar with the CLI as well as syntax of HOSTS you could make do with COPY CON

Having said that, if the HOSTS file is read only the edit will not save unless one also makes use of the ATTRIB command to remove the READ ONLY attribute.

Collapse -
easy fix
by JB_Denver / August 11, 2010 4:58 AM PDT

If you are using Explore to navigate your way to the C:\WINDOWS\system32\drivers\etc\hosts- file you can right click on the Hosts file and deselect the Read Only attribute click apply then edit file and save. I also recommend that when your done go back and reselect the read only button.

I added the following lines to the bottom of the file and no longer have the hotmail advertisements bogging me down. You can copy and paste the following into your etc/hosts file and IE will stop the ads and free up lots on system memory

# I added to stop hotmail ads
# end of list I added

Collapse -
Antivirus software blocking access
by pgbev1 / August 11, 2013 10:48 AM PDT

Also check antivirus software settings for host file blocking. Be sure to change it back when done

Collapse -
This worked for me
by pately21 / September 3, 2013 8:39 PM PDT

Make Sure that you right click the hosts file and in the properties untick "read only"

Then you can follow this guide from microsoft

it's just simply that you open notepad as "run as administrator"
then open the hosts file from the file menu in notepad
then edit it
and click save

hopefully it should work!

Collapse -
by DavidChaze / September 4, 2013 4:23 AM PDT

Open explorer and click on windows and then system32 and drivers and etc there is host file open it with notepad.

Where are you striking trouble you may need to if you are on XP open explorer and go to view folder options and tick/untick the option re showing hidden files/folders.

Collapse -
host file
by bilardomemozin / October 22, 2014 1:09 AM PDT

right click
uncheck read only
now is ok

Collapse -
Work around
by MJConsulting / January 28, 2016 10:19 AM PST

This worked for me
by pately21
Was the easiest solution for me

Popular Forums
Computer Newbies 10,686 discussions
Computer Help 54,365 discussions
Laptops 21,181 discussions
Networking & Wireless 16,313 discussions
Phones 17,137 discussions
Security 31,287 discussions
TVs & Home Theaters 22,101 discussions
Windows 7 8,164 discussions
Windows 10 2,657 discussions


Help, my PC with Windows 10 won't shut down properly

Since upgrading to Windows 10 my computer won't shut down properly. I use the menu button shutdown and the screen goes blank, but the system does not fully shut down. The only way to get it to shut down is to hold the physical power button down till it shuts down. Any suggestions?