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


Email SubscriptionPrefer an E-mail subscription?

Enter your email address:

Delivered by FeedBurner

Leave a Reply