HOWTO: Get Instant Access to the HOSTS file

The HOSTS file is a file used to map IP addresses to domains. There are many uses for it — my favorite it to block ad servers. The HOSTS file has no extension, so you can’t associate a program with it automatically to open it all the time. Instead, you can create a shortcut that calls a text editor of your choice to open it.

Create a desktop shortcut with the following program path to open the HOSTS file in Notepad:

notepad "c:\windows\system32\drivers\etc\hosts"

Create a desktop shortcut with the following program path to open the HOSTS file in WordPad:

"c:\program files\windows nt\accessories\wordpad.exe" "c:\windows\system32\drivers\etc\hosts"

If you want to auto-open it in any other editor, just change the first path to the program editor’s main executable.

Once you have your shorcut, rename it to hosts and drop it in C:\windows\ so you can run it from the Run box by entering in hosts and hitting enter.

Watch a screen cast of it right now:[kml_flashembed movie="http://www.allthingsmarked.com/storage/hosts.swf" height="483" width="413" /]

Comments

  1. You can use this in the run box also and it does open it automatically without it asking for association.

    notepad %systemroot%\system32\drivers\etc\hosts

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>