Sunday, November 04, 2007

How to modify your hosts file on Windows Vista

The enhanced security on Windows Vista is good, but sometimes even the simplest of tasks become a pain. For eg: I run xampp on my box and have require various virtual hosts - I also setup numerous domains and make an entry for them in my HOSTS file.

I switched to Vista very recently (I bought a new laptop :) and I simply couldn't modify the hosts file. After looking around and figuring how things work on Vista, here are the steps to change your hosts file on Windows Vista.

1) Browse to Start -> All Programs -> Accessories
2) Right click "Notepad" and select "Run as administrator"
3) Click "Continue"
4) Click File -> Open
5) Browse to "C:\Windows\System32\Drivers\etc"
6) Change the file filter drop down box from "Text Documents (*.txt)" to "All Files (*.*)"
7) Select "hosts" and click "Open"
8) Make the needed changes and close Notepad.
9) Save the file.

That's it you should now be able to add all those domains into your hosts file :)

Also, for people having problem running Eclipse, right click on the eclipse.exe and say "Run as administrator".

-Mandy.