Everybody who has ever migrated to a new hosting provider, purchased a new domain name or made DNS changes has done it: adding lines to your hosts file to “hard code” the ip address of a server host name on the workstation you are working on.
On Windows, this has become a pain since the UAC feature was introduced. In order to modify, you need elevated permissions, so you need to start your favorite text editor as administrator. On top of that, the file is buried somewhere in the deepest cave of your c-drive (C:\Windows\System32\drivers\etc\).
There must be an easy way to do this. I managed to reduce it to two clicks via a shortcut on my desktop, with the procedure below. Who can do better? One click only?
- Right-click your desktop
- In the context menu, select New > Shortcut
- In Type the location of the item, enter C:\Windows\System32\notepad.exe C:\Windows\System32\drivers\etc\hosts
- Click Next
- In Type a name for this shortcut, type any name you want (I used Edit hosts file)
- Click Finish
- Right-click the new icon on your desktop and select Properties
- On the Shortcut tab, click the Advanced button
- Check Run as administrator and click OK
- Click OK
Seems to be a lot of work, but it will save you numerous clicks whenever you need to edit the file again.