• Skip to main content
  • Skip to primary sidebar

Technipages

Smart phone, gadget and computer tutorials

  • Topics
    • Android
    • Gaming
    • Hardware
    • Internet
    • iOS
    • MacOS
    • Office
    • Software
    • Windows
    • Definitions
  • Product Reviews
  • Downloads
  • About
Windows 10: Access Denied When Modifying HOSTS or LMHOSTS file

Windows 10: Access Denied When Modifying HOSTS or LMHOSTS file

By Mitch Bartlett 1 Comment

You might get an error when you try to edit the LMHOSTS or HOSTS file in Microsoft Windows 10 that says one of the following:

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

or

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

This problem is usually related to not having proper rights to the file. To solve this problem, follow these steps.

Allow Access One Time

  1. Select “Start” > “All Programs” > “Accessories“.
  2. Right-click on “Notepad” and select “Run as administrator“.
  3. If you are prompted for an administrator password or for a confirmation, type the password, or select “Allow“.
  4. Open the Hosts file or the Lmhosts file, make the necessary changes, and then click “Save” on the “File” menu.

Permanently Allow Access

Note: This option is not recommended as it may allow a virus or malware to easily modify the Hosts or Lmhosts file.

  1. Right-click the Hosts or Lmhosts file and select “Properties“.
  2. Select “Security“.
  3. Select the “Edit…” button to edit permissions.
  4. Select “Add…“.
  5. Type your username to allow just your account access, or type “EVERYONE” to allow access to anybody. Select “OK” when you’re ready.
  6. With the account you just added higlighted in the “Group or user names” area, select the “Allow” check for “Full control“. Select “OK” when you’re ready.

Now you should have access to edit the file and no longer receive “Access Denied” messages when attempting to work with it.

If you still cannot edit these files, you may want to look into whether or not you have malware or viruses installed on the computer. Try running a MalwareBytes scan to see if you can clear it up.

You Might Also Like

  • Windows: "Access Denied" When Running Attrib
    Windows: "Access Denied" When Running Attrib
  • Error: "User username (SessionId=2) could not be logged off. Access is denied."
    Error: "User username (SessionId=2) could not be…
  • Acrobat Reader 11: Fix "There was an error opening this document. Access denied."
    Acrobat Reader 11: Fix "There was an error opening…
  • Fix "Access to the registry key is denied" Error When Setting Policy For PowerShell Scripts
    Fix "Access to the registry key is denied" Error…
  • Can't Delete Folder "You have been denied permission" Fix for Windows
    Can't Delete Folder "You have been denied…
  • What Is the Windows Registry and How to Access It?
    What Is the Windows Registry and How to Access It?
  • How to Access Drivers in Windows 10
    How to Access Drivers in Windows 10
  • Windows 10: How to Pin Item to Quick Access
    Windows 10: How to Pin Item to Quick Access
  • How To Access A Windows 10 Computer Remotely
    How To Access A Windows 10 Computer Remotely

Filed Under: Windows Tagged With: Windows 10

Reader Interactions

Comments

  1. Jennifer says

    January 28, 2020 at 3:22 pm

    Super helpful post, worked perfect using Notepad “Run as Administrator” THANK YOUR FOR THE TIPS!

Did this help? Let us know! Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Recent Posts

  • Fix: Slack Screen Sharing Not Working
  • How to Listen to Thousands of Radio Stations Worldwide for Free
  • How to Delete WhatsApp Chat Backup from Google Drive
  • Bitwarden: How to Manually Synchronize Your Vault
  • Bitwarden: How to Exclude a Domain
  • How to Get the Most out of Google Keep
  • Bitwarden: How To Generate a Passphrase
  • Bitwarden: How To Add an Identity To Your Vault

Who’s Behind Technipages?

Baby and Daddy My name is Mitch Bartlett. I've been working in technology for over 20 years in a wide range of tech jobs from Tech Support to Software Testing. I started this site as a technical guide for myself and it has grown into what I hope is a useful reference for all.

Follow me on Twitter, or visit my personal blog.

You May Also Like

  • Random Access Memory (RAM)
  • Encapsulated Postscript (EPS) File
  • File Compression Utility
  • Windows 95/98
  • Microsoft Windows NT
  • Microsoft Windows
  • Microsoft Windows 95
  • Windows Media Player (WMP)

© Copyright 2021 Technipages · All Rights Reserved · Privacy