TechSpot

Windows won't let me save hosts file

By MissMichiru
Apr 29, 2010
  1. I'm using my personal laptop that runs Windows Vista. I want to block a website from my computer so I won't play it. I followed all the instructions on how to properly go to the hosts file and put in the information. However, whenever I save, it says it cannot create the file, though there is already a hosts file. I also run Notepad as administrator and make sure to save the file as all files. Also, this is the only account on this laptop, so it should be admin. Any way I can fix this problem?
     
  2. wii-ste

    wii-ste TS Rookie Posts: 163

    When you run Notepad as administrator, how are you opening the file? ie. Are you using file and open?

    If you just run Notepad as administrator and then double-click the file, it will run Notepad again without administrator rights.
     
  3. ComputerGuy55

    ComputerGuy55 TS Maniac Posts: 380   +8

    Steps to successfully edit the Hosts file on your computer:

    GO to Start, type CMD right click and Run As Administrator.

    in this black window, type cd \ and hit Enter, now type takeown /f c:\windows\system32\drivers\etc\hosts and hit Enter.

    now type icacls c:\windows\system32\drivers\etc\hosts /grant:r <YOUR USERNAME>:f and hit Enter

    Note: there is a space after hosts, there is no space between the : and the letters, and there is a space after /grant:r

    Where I put <YOUR USERNAME> this is the name that appears when you click on Start, at the top.

    It must be typed as I put it there for it to work, I have done this with many computers it does work.. Also if it asks you to "save" the document upon editing it, right click the file and go to Properties make sure that Read Only is not checked.
     
Topic Status:
Not open for further replies.

Similar Topics

Add New Comment

You need to be a member to leave a comment. Join thousands of tech enthusiasts and participate.
TechSpot Account You may also...