Edit Hosts file in Windows 7

by Marty on June 23, 2010

Windows 7

After just having (finally) upgraded to Windows 7, I’ve come across a number of issues that aren’t necessarily typical from a Windows machine. This is the first.

I normally run a batch file to patch the hosts file on various machines. On Windows 7, it had no effect – despite the fact that I had logged on with an account that has administrative privelages.





You may received a warning resembling one of the following if you try to edit hosts manually.

Access to C:\Windows\System32\drivers\etc\ hosts was denied

or

Cannot create the C:\Windows\System32\drivers\etc\hosts file

Solution?

1. Open ‘Notepad’ from the Start Menu
2. Right click on Notepad and select ’Run as administrator’
3. Click ‘File->Open’ and browse to the hosts file at this location:

C:\windows\system32\drivers\etc\hosts

Open the file and edit. Click ‘Save’.

You cannot drag the hosts file into notepad and edit directly. You may encounter the same problem with other files (as I have), and this same method applies.

Share this page:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Add to favorites
  • email
  • FriendFeed
  • Identi.ca
  • LinkedIn
  • Live
  • StumbleUpon
  • Technorati
  • Twitter
  • Yahoo! Bookmarks

If you liked this article, you may also like:

  1. Simple PHP file counter

Leave a Comment

Previous post:

Next post:

Get Adobe Flash playerPlugin by wpburn.com wordpress themes