Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

Symptoms

When you try to change the Hosts file or the Lmhosts file in Microsoft Windows Vista, Windows 7 or Windows 8 you may receive an error message that resembles either of the following.

Error message 1

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

Error message 2

Cannot create the C:\Windows\System32\drivers\etc\hosts file.
Make sure that the path and file name are correct.

This issue occurs even though you log on by using an account that has administrative credentials.

Workaround

For Windows 8 follow these steps:

1. On the Start screen, right click and choose All apps located at the bottom right corner.

2. Look for the Notepad application and right-click on Notepad.

3. At the bottom left corner click Run as administrator.

Note: If you are prompted for an administrator password or for a confirmation, type the password, or click Allow or Yes.

4. Open the Hosts file or the Lmhosts file, make the necessary changes, and then click Save on the File menu.

For Windows Vista and Windows 7 follow these steps:

  1. Click Start  windows icon, click All Programs, click Accessories, right-click Notepad, and then click Run as administrator.

    Notice icon If you are prompted for an administrator password or for a confirmation, type the password, or click Allow or Yes.

  2. Open the Hosts file or the Lmhosts file, make the necessary changes, and then click Save on the Edit menu. If using Windows 7, you will need to click Save on the File menu.

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

Was this information helpful?

What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×