Quick link to edit the hosts file on Windows 7

If you edit your hosts-file often it can be practical to have a shortcut that opens the file in a texteditor. This is how you would create such a shortcut on Windows 7:

  1. Create a normal shortcut to the program notetad on your desktop.
  2. Edit the target of the link by adding %SystemRoot%\system32\drivers\etc\hosts at the end. That way the target of the link will be something like: %windir%\system32\notepad.exe %SystemRoot%\system32\drivers\etc\hosts.
  3. When you use the link you must right-click it and select "run as administrator". Otherwise you won't be able so save your changes.

Here is an image of the settings-window after I changed the target of the link: