Windows Legacy OS forum

General discussion

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

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?

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

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?

Mark

Collapse -
Follow these steps

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

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 ...

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

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..

In reply to: If the previous suggestions do not work it is ...

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

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

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

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
127.0.0.1 rad.msn.com
127.0.0.1 live.rads.msn.com
127.0.0.1 ads1.msn.com
127.0.0.1 static.2mdn.net
127.0.0.1 g.msn.com
127.0.0.1 a.ads2.msads.net
127.0.0.1 b.ads2.msads.net
127.0.0.1 ad.doubleclick.net
127.0.0.1 ac3.msn.com
127.0.0.1 ec.atdmt.com
# end of list I added

Collapse -
Antivirus software blocking access

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

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

Collapse -
This worked for me

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

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

Then you can follow this guide from microsoft

http://support.microsoft.com/kb/923947

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 -
solution

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

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

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

right click
properties
uncheck read only
now is ok

Collapse -
Work around

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

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

Popular Forums

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

GIVEAWAY

Enter to win* a free holiday tech gift!

CNET's giving five lucky winners the gift of their choice valued up to $250!