Subscribe to our RSS feed     Get daily updates in your mail box

Add “Edit HOSTS file” option in the context menu

The HOSTS file, originally introduced to resolve host names to IP addresses, is also an effective tool to block Malware. To modify the HOSTS file in Windows Vista, you need to elevate Notepad.exe or any other text editor which you use. Otherwise you’ll see the following error when trying to save the HOSTS file:

Cannot create the C:\Windows\system32\drivers\etc\hosts file.

Make sure that the path and the file name are correct.

(There is a Microsoft Knowledgebase article that discusses this issue. See You cannot modify the Hosts file or the Lmhosts file in Windows Vista)

Coming to the subject, here is a tip which adds the Edit HOSTS file option in the (My) Computer context menu, which when clicked, runs Notepad.exe elevated and opens the HOSTS file for you. This again uses the runas verb for elevation.

EDIT HOSTS FILE - CONTEXT MENU OPTION

1. Download EditHosts.reg and save to Desktop

2. Right-click EditHosts.reg and choose Merge

3. Click Yes when asked for confirmation.

4. Edit HOSTS file option is now in the context menu of (My) Computer.

UNDO INFORMATION

To remove the Edit HOSTS file from the context menu, download EditHosts-Undo.reg and apply it.

MORE INFORMATION

To recollect things, we’ve used the runas verb in the past to do the following:

RELATED POSTS


Bookmark this Page!BlinkList | del.icio.us | Digg it | Furl | reddit | Spurl | StumbleUpon | Wink |
If you enjoyed this post, make sure you subscribe to our RSS feed! We feature Tips, Troubleshooting information, Scripts and Utilities for Microsoft Windows Operating Systems!
Prefer an E-mail subscription?

Enter your email address:

Delivered by FeedBurner

There Are 2 Responses So Far. »

  1. [...] Add “Edit HOSTS file” option in the context menu [...]

  2. [...] a file or folder from the context menuAdding the Run as Administrator option for .VBS and .JS filesAdd “Edit HOSTS file” option in the context menuRegister DLLs (elevated) using the context menuOpen Command Window Here - Make available from folder [...]

Post a Response