Windows7 will not let me edit the hosts file and save it

Anonymous
2010-04-16T18:31:57+00:00

Windows7 will not let me edit the hosts file and save it. What must I do in order to save the edited host file?

Windows for home | Previous Windows versions | Files, folders, and storage

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
Answer accepted by question author
Anonymous
2010-04-16T18:47:57+00:00

It's a built-in safety feature.  There is an easy workaround.  ClickStart ->All Programs -> Accessories.  Right-clickNotepad, and then click Run as administrator.  If you are prompted for an administrator password or for a confirmation, type the password, or clickAllow or Yes.

Open the Hosts file (from the notepad you just opened) , make your changes, and then click File ->Save

Barbara

Was this answer helpful?

200+ people found this answer helpful.
0 comments No comments
Answer accepted by question author
Anonymous
2010-04-16T20:43:01+00:00

You need to either take ownership of the file (Right click the hosts file, Security tab, and give yourself full rights), or open Notepad as Administrator and open, edit and save your hosts file from there. It's designed that way so some rogue malware can't come in and change that.

Was this answer helpful?

70+ people found this answer helpful.
0 comments No comments

66 additional answers

Sort by: Newest
  1. Anonymous
    2013-02-28T10:49:31+00:00

    1-create new text file using any editor

    2-copy the contents of "hosts" file to the new file

    3-edit things you want to edit

    4-save at any location and name it hosts without any extensions

    5-be sure you have all administrative permissions

    6- copy and paste the new hosts file at the same location of the original one

    *If you use win7 this is the path 

    C:\Windows\winsxs\x86_microsoft-windows-w..nfrastructure-other_31bf3856ad364e35_6.1.7600.16385_none_045b589158ae90da

    7-replace the file

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2012-12-26T18:45:56+00:00

    I was unable to save the hosts as file (without the txt extension) by doing the following:

    1. Run notepad as administrator
    2. navigate to your hosts file folder
    3. Drop down to show "All Files" (you should see about 5 files)
    4. Open your current hosts file (probably named with the txt file extension if you are currently having this problem)
    5. Copy the contents of the hosts file (maybe smart to backup this text somewhere else)
    6. Delete the hosts file
    7. Copy one of the other files in this folder (the etc folder) and paste
    8. Open the copied file and paste in the text from the hosts file, then hit ctrl +s to save
    9. Rename the copied file to hosts

    If you had the same problem as me, this should work fine

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2012-12-14T00:18:19+00:00

    Allen,

    Thank you!!  I changed HOSTS in two minutes.  I have spent hours trying complicated suggestions that did not work.

    BJ

    Was this answer helpful?

    0 comments No comments