Join 100,000 Subscribers:

 

Stupid Geek Tricks: Create a Shortcut to Quickly Edit Your Hosts File

As a programmer that does a lot of work on web sites, I end up having to edit my hosts file far too often, and in Windows 7 or Vista, you have to use Notepad in Administrator Mode. Tedious.

My quick and easy solution to this problem is so simple that it barely deserves a full article, but we’re going to cover it anyway—basically, you just create a shortcut to edit the file in Notepad, and set the properties to always start as Administrator. The final step is to create that shortcut in the Start Menu, so it will be easily accessible with the start menu search engine.

Once you’re done, all you have to do is type hosts into the start menu, and you can edit the Hosts file.

Let’s Make a Shortcut! 

Open up the start menu folder—for those of you that might be new, we’ve covered how to easily open up the start menu folder in Windows 7. Then right-click and create a shortcut, with the following location:

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

image

Once you’ve created the shortcut, and make sure you give it a useful name like “Edit Hosts”, you should open up the shortcut properties, click the Advanced button, and then select the “Run as administrator” option.

image

Once you’ve done so, you can simply type hosts into the start menu to pull up the item…

image

You’ll be prompted to accept the UAC prompt, since you have to edit the hosts file in administrator mode.

image

And there we are. Edit away!

image

And yes, you might point out that you can simply change the permissions on the Hosts file to not require admin mode, but that would lead to a less secure system, since malware often tries to edit the hosts file.

Also, you might point out that this was such a simple and easy topic that I shouldn’t have bothered. But I did! Loss of geek points for me.

| More
This article was originally written on 11/23/09 Tagged with: Shortcuts and Hotkeys, Vista, Windows 7, XP

Daily Email Updates

You can get our how-to articles in your inbox each day for free. Just enter your name and email below:


Name:
Email:

Comments (3)

  1. jan

    Use hostman instead of notepad!
    It’s the easiest way to enable/disable the hostfile!
    http://www.abelhadigital.com/2.....eased.html

    And the best part: it’s freeware too, give it a try!

  2. Steven

    YES! I have this problem all the time.

    Thanks so much for the tip!

    Also, for users who use something besides notepad, you can just stick the location of your alternative notepad in place of “notepad” in the shortcut.

    Like this:

    “C:\Program Files\JGsoft\EditPadPro6\EditPadPro.exe” c:\windows\system32\drivers\etc\hosts

  3. davepermen

    If you want to make it more geeky, create a task in the task planer, that gets highest privileges. and then, create a shortcut to that task. doing so, you can use that shortcut to directly elevate notepad, without an UAC dialog popping up.


Leave a Comment




Leave your friendly comment here.

If you have a computer help question, click here to leave it on the forums instead.

Note: Your comment may not show up immediately on the site.

Our Friends
Getting Started
About How-To Geek
What Is That Process?
svchost.exe
jusched.exe
dwm.exe
ctfmon.exe
wmpnetwk.exe
mDNSResponder.exe
wmpnscfg.exe
rundll32.exe
wfcrun32.exe
Ipoint.exe
Itype.exe
Wfica32.exe
Mobsync.exe
conhost.exe
Dpupdchk.exe Adobe_Updater.exe

Copyright © 2006-2010 HowToGeek.com. All Rights Reserved.