In an earlier post I explained how to go about running root-level commands from the command line on Vista. Today I ran into a similar problem today while adding a virtual host to my Apache configuration. As you might know, adding a virtual host entry to httpd.conf is only part of the task; you also need to modify the hosts file, which resides at C:\Windows\System32\drivers\etc. However, it’s no longer possible to just open notepad and change the file; you need to do so under the root privilege, much like is done using sudo on Linux.
The process is actually quite similar to that described in the previous entry. Just navigate to Start -> Programs -> Accessories -> Notepad, right click and select Run as administrator.
Once opened, navigate to the hosts file, make your changes, and you’ll be able to save without issue.
Jason
See you at CodeMash! – www.codemash.org