How to edit the Hosts file in 7

Page 3 of 4 FirstFirst 1234 LastLast

  1. Posts : 4,573
       #21

    DrWho said:
    ...I do have some experience ...
    When I tried to edit it by adding another entry, it saved my work to Hosts.txt and not the main Hosts file itself. Hmmmmm!

    My solution was to rename the main HOSTS file to HOSTS.bac and then rename the hosts.txt file to HOSTS (NO Extension).
    That worked like a treat.
    Chuckle.

    Your solution, while clever, was unnecessary. Your HOSTS file did not save or rename anything. The text editor that you used had the default text file extension selected. You can Save As... All Files (*.*), Any File (*.*) in some editors, and assign the extension - or no extension - during the save process.

    The HostsMan app is suitable enough. All users who introduce themselves to HostsMan are advised - thoroughly examine the contents of HOSTS after any and all updates. HostsMan updates will include many popular sites for blocking - MySpace, FaceBook, HomeStead, et cetera.

    I happen to like blocking sites like those for some customers, but they are not, in and of themselves, malicious sites.
      My Computer


  2. Posts : 75
    WIN7
       #22

    DrWho said:
    Sorry, I didn't mean to rant or ramble.

    Cheers Mates!
    The Doctor
    It's a good topic to rant on.
    A well managed host file can make browsig the interweb a little less of a hassle. (It can screw up a few sites too tho...ymmv.)

    I use the host file from here on all my pc's. (mvps.org)

    I also add some google analytics references cuz, as terrific as many google products are, they just make me feel uncomfortable...one company with alllll that data.
      My Computer


  3. Posts : 154
    Windows XP-Pro-SP3, Windows 7
       #23

    Well, one neat trick I've found with Hosts Manager, if you find that your hosts file may be blocking some site that you want to go to, you can just click the big green "H" in the Hosts window to turn off the hosts file. The "H" then turns RED while the hosts file is disabled.
    Then browse away!
    No problemo!

    Doc B)
      My Computer


  4. Posts : 4,573
       #24

    You said you had experience with the HOSTS file.

    To anyone learning how to use the HOSTS file:

    To disable an entry in the HOSTS file,
    delete the line(s) containing the entry
    or
    insert a # as the first character in the offending line(s).

    The Green H/Red H method suggested will leave your computer without the protection and other functions provided by HOSTS.

    Please note: many HOSTS files found online are provided solely for the blocking of ad servers. Others provide blocking of malware. Others provide both.

    Furthermore, a simple batch file can toggle the name of the HOSTS file - creating an On/Off effect. The same batch file can also rename the link used to call the batch file, providing an instant status report of the HOSTS file status - no additional software required.

    The sample provided here does not include the shortcut rename trick.
    Is it possible to make Firefox ignore the Hosts file without closing it down? - mozilla.support.firefox | Google Groups
      My Computer


  5. Posts : 4,573
       #25

    The batch command referenced below with the shortcut rename included. Please note the path will not work on your PC. Modify as needed.

    @echo off
    cls
    goto toggleRename

    :toggleRename
    If Not %winbootdir%'==' Set HostsOff=%windir%\NOHOSTS
    If %OS%'==Windows_NT' Set HostsOff=%SystemRoot%\system32\drivers\etc\NOHOSTS
    If %HostsOff%'==' goto noIdeaOfOS
    If Not %winbootdir%'==' Set HostsOn=%windir%\HOSTS
    If %OS%'==Windows_NT' Set HostsOn=%SystemRoot%\system32\drivers\etc\HOSTS
    If %HostsOn%'==' goto noIdeaOfOS
    If Not Exist %HostsOff% goto deActivate
    goto Activate
    goto end

    :deActivate
    if not exist %HostsOn% goto noHostsFile
    ren %HostsOn% NOHOSTS
    ren "D:\XPbin\Antman\Application Data\Microsoft\Internet Explorer\Quick Launch\Toggle Hosts ON.lnk" "Toggle Hosts OFF.lnk"
    echo.
    echo ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ
    echo Ý ÚÄÄÄ¿Þ
    echo Ý HOSTS FILE BLOCKING IS NOW DE-ACTIVATED ³ X ³Þ
    echo Ý ÀÄÄÄÙÞ
    echo. ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß
    echo.
    echo. Advertising will be visible; Parasite protection off!
    echo Renamed from HOSTS to NOHOSTS
    echo.
    goto end

    :Activate
    if not exist %HostsOff% goto noHostsFile
    ren %HostsOff% HOSTS
    ren "D:\XPbin\Antman\Application Data\Microsoft\Internet Explorer\Quick Launch\Toggle Hosts OFF.lnk" "Toggle Hosts ON.lnk"
    echo.
    echo ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ
    echo Ý ÚÄÄÄ¿Þ
    echo Ý HOSTS FILE BLOCKING IS NOW ACTIVATED ³ û ³Þ
    echo Ý ÀÄÄÄÙÞ
    echo. ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß
    echo.
    echo. Advertising will be hidden; Parasite protection on!
    echo Renamed from NOHOSTS to HOSTS
    echo.
    goto end

    :noIdeaOfOS
    echo Sorry Unsupported OS.
    goto end

    :noHostsFile
    cls
    echo.
    echo ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ
    echo Ý ÚÄÄÄ¿Þ
    echo Ý ERROR NO HOST FILES FOUND ! ³ ! ³Þ
    echo Ý ÀÄÄÄÙÞ
    echo. ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß
    echo .
    echo Couldn't find "HOSTS" or "NOHOSTS" in the folder
    echo.
    echo please check that the HOSTS file is in this folder
    echo thanks..

    :end
    set HostsOff=
    set HostsOn=
    pause
    exit
      My Computer


  6. Posts : 22,814
    W 7 64-bit Ultimate
       #26

    Seven Forums now has a tutorial on the subject of the Hosts File, it can be view at the link below.

    Hosts File : Use in Windows 7 / Vista
      My Computer


  7. Posts : 328
    Windows 7
       #27

    I realise this is an old thread though this info helped me with the same issue;

    Where is the Hosts File on Windows x64? | sepago
      My Computer


  8. Posts : 22,814
    W 7 64-bit Ultimate
       #28

    Bare Foot Kid said:
    Seven Forums now has a tutorial on the subject of the Hosts File, it can be view at the link below.

    Hosts File : Use in Windows 7 / Vista




    You get a whole lot more useful info in this one.
      My Computer


  9. Posts : 1
    Windows 7 Home Premium x64
       #29

    DrWho said:
    Please, don't anyone think that I'm promoting myself as a HOSTS expert, but I do have some experience with it.

    I first ran into using the HOSTS file some time (years) ago when I needed to change the Server designation for my Anti-Virus program, to use the Professional Server instead of the FREE server.

    Anyway, I just opened Win-7 and accessed my HOSTS file.
    When I tried to edit it by adding another entry, it saved my work to Hosts.txt and not the main Hosts file itself. Hmmmmm!

    My solution was to rename the main HOSTS file to HOSTS.bac and then rename the hosts.txt file to HOSTS (NO Extension).
    That worked like a treat.

    However, all this was only an effort to verify, for myself, what's being said here in this thread.
    Actually, I never really needed to go through all those acrobatics to work with my hosts file. I use the "Hosts Manager" program from "abelhadigital(dot)com" and I use it weekly to keep my HOSTS file up to date. It lets me view and edit my hosts file at will.

    I've been doing this for quite some time now and I share the HOSTS Manager program with many of my customers, so they can keep their own HOSTS file up to date. It's a great protection against your browser being redirected to a porn site, or worse.

    HOSTS Manager is almost a "Must Have" when children are using the home PC. I won't set up a PC without it. It's just one more level of security.

    Sorry, I didn't mean to rant or ramble.

    Cheers Mates!
    The Doctor
    THANK YOU! I tried everything, renaming it to BAK and it said I didn't have permissions! I even tried changing permissions before that, and it worked with any other file besides the hosts file. Thank you, that program did the trick :)

    Oh yeah sorry for 1 and a half year bump...OOPS! :O
      My Computer


  10. Posts : 2
    Chicago
       #30

    For a detailed tutorial with pictures, follow this post Edit Hosts File in Windows 7
      My Computer


 
Page 3 of 4 FirstFirst 1234 LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 17:10.
Find Us