• Skip to main content
  • Skip to primary sidebar

Technipages

Tutorials and fixes for smartphone, gadget, and computer problems

  • Topics
    • Android
    • Browsers
    • Gaming
    • Hardware
    • Internet
    • iPhone
    • Linux
    • macOS
    • Office
    • Reviews
    • 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

October 10, 2017 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
  • Windows: "User username (SessionId=2) could not be logged off. Access is denied." Fix
    Windows: "User username (SessionId=2) could not be logged…
  • Acrobat Reader: Fix "There was an error opening this document. Access denied."
    Acrobat Reader: Fix "There was an error opening this…
  • Fix "Access to the registry key is denied" Error When Setting Policy For PowerShell Scripts
    Fix "Access to the registry key is denied" Error When…
  • Can't Delete Folder "You have been denied permission" Fix for Windows
    Can't Delete Folder "You have been denied permission" Fix…
  • Fix Sublime Text Error Permission Denied
    Fix Sublime Text Error Permission Denied

Filed Under: Windows

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!

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

  • Windows 11: What is Dynamic Lock and How to Set It Up
  • How to Use Google Pay on Android
  • What is a Firefox Primary Password and How to Create One
  • Fix: Windows 11 Mic Not Working
  • How to Update Galaxy Tab S8
  • How to View a List of Recently Uninstalled Apps on Android
  • How to Sign Into WhatsApp on Multiple Devices
  • Dedicated Server vs. Shared Hosting Server

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.

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 2023 Guiding Tech Media · All Rights Reserved · Privacy