- MAXIMUMpcguides - http://www.maximumpcguides.com -

Edit the Windows Vista Hosts File

Posted By Brent Trahan On 1.13.07 @ 9:45 pm In All, Customization, Recently Updated, Vista, Windows | 16 Comments

Introduction

I develop and manage my websites and need to edit my hosts file when I’m at certain locations to bypass DNS settings when testing new sites.

It took me a little while and a little research but I figured out how to edit the hosts file in Vista.

Edit the Hosts File

Non-frequent Edit

  1. Open Notepad with Administrative privileges by clicking Start, All Programs, Accessories, and then right-click Notepad and select to open as Administrator.
  2. Now that Notepad is open with Administrative privileges browse to (C:\Windows\System32\drivers\etc) in Notepad and open the hosts file.

Now you can edit and save the hosts file.

Frequent Editing

I sometimes frequently edit my hosts file and like a shortcut on my desktop for easy editing. Here’s how to create a shortcut on your desktop and lets you quickly and easily open your hosts file with Notepad and edit it.

  1. Send a shortcut to Notepad to your desktop by right-clicking Notepad in the start menu and selecting send to desktop.
  2. Right-click the shortcut to Notepad on your desktop and select properties.
  3. Click the advanced button near the bottom of the shortcut tab and check off run as administrator. Click OK in the advanced properties window.
  4. Replace %SystemRoot%\system32\notepad.exe with %SystemRoot%\system32\notepad.exe C:\Windows\System32\drivers\etc\hosts in the target box. Click OK in the properties window to save the changes.

Now all you have to do is open that shortcut to open your hosts file with Notepad with administrative privileges.

Thanks to the first few commenters on this guide for pointing this out to me.


Article printed from MAXIMUMpcguides: http://www.maximumpcguides.com

URL to article: http://www.maximumpcguides.com/edit-the-windows-vista-hosts-file/

Copyright 2006-2008 Brent Trahan. All rights reserved.

Microsoft Windows is a registered trademark of Microsoft Corporation. Microsoft Corporation in no way endorses or is affiliated with MAXIMUMpcguides.com. All other products mentioned are registered trademarks of their respective companies. MAXIMUMpcguides IS NOT RESPONSIBLE for any damage or data loss to your computer from using this web site. All information on MAXIMUMpcguides is provided on an AS IS basis with NO WARRANTIES.