Edit HOSTS file in Windows 7 from right click context menu


Previously we published a tutorial on how to edit HOSTS file in Windows 7 using Notepad. This time, we will show you a nice and simple trick, so that you can edit HOSTS file in 7 right from the context menu. At the end of the tutorial, you will get something like this:

 

Edit HOSTS file in Windows 7 from right click context menu

 

What is HOSTS file?

 

The hosts file is one of several system facilities to assist in addressing network nodes in a computer network. It is a common part in a operating system’s Internet Protocol (IP) implementation, and serves the function of translating human-friendly hostnames into numeric protocol addresses, called IP addresses, that identify and locate a host in an IP network.

In some operating systems, the host file content is used preferentially over other methods, such as the Domain Name System (DNS), but many systems implement name service switches (.e.g., nsswitch.conf) to provide customization. Unlike the DNS, the hosts file is under the direct control of the local computer’s administrator.

Reference: Cisco Networking Academy Program: First-Year Companion Guide”, page 676 (2nd Edition). Cisco Systems, Inc., 2002, ISBN 1-58713-025-4.

 

Which Operating Systems supports blocking of HOSTS file?

 

Mac OS X, UNIX, UNIX like (), Windows, Symbian, iOS, etc.

 

How to add the option edit HOSTS file in Windows 7 from right click context menu?

 

There are two ways: via vbs file (not recommended by us) or adding a registry value. We will show the second way.

 

Open Notepad and write this code:

 


Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\\shell\runas]
@=”Edit HOSTS file”
“HasLUAShield”=”"

[HKEY_CLASSES_ROOT\Directory\Background\shell\runas\command]
@=hex(2):6e,00,6f,00,74,00,65,00,70,00,61,00,64,00,2e,00,65,00,78,00,65,00,20,\
00,25,00,77,00,69,00,6e,00,64,00,69,00,72,00,25,00,5c,00,73,00,79,00,73,00,\
74,00,65,00,6d,00,33,00,32,00,5c,00,64,00,72,00,69,00,76,00,65,00,72,00,73,\
00,5c,00,65,00,74,00,63,00,5c,00,68,00,6f,00,73,00,74,00,73,00,00,00

 


Now, save the file from Notepad’s File > Save menu with any name you like, say Add HOSTS file option.reg and do not forget to change the file type to All from Text documents from drop down menu as we already said in other tutorials.

Just double click the file and accept all the security prompts to get the option.

 

How to this option or revert to default?

 

Very easy. Just a registry file with notepad again, just add a minus sign before the HKEY starts; i.e. [-HKEY_CLASS... keep others as before. Save the file like above and run it and you will get rid of the option.

Here are both registry files for your convenience, just click to download and use them.

 

Caution:

 

This are potentially dangerous tweaks to play with for new users. Do not download from places like forums where unknown users or members posts with malicious codes embedded within it.

 

Signature


Incoming search terms:

edit host file by regedit,add ip in host file by regedit,edit hasluashield value,edit host in windows 7 for css,host file open in background,regedit context menu,right click add to host,vbsscript write to host file in windows 7,which should be the context of host file in windows 7?
If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.
About Abhishek

Abhishek Ghosh is an Orthopedic Surgeon, Inventor with 216 Patents, Current editor of The Customize Windows Media Group. You can follow and know more about Dr. +Abhishek Ghosh on Google Plus and follow on Twitter as @AbhishekCTRL.

Speak Your Mind

*