FIX: Access denied when editing hosts file in Windows 10

Sometimes in order to fix some errors, you need to edit the host files, but the host files can’t be edited with unauthorized access. Here are some ways to edit the host files in Windows 10.

Photo by Eduardo Dutra

How to fix the access denied issue when editing hosts file in Windows 10?

Running notepad as admin:

  • Press Windows key + S key
  • Now search notepad
  • Right-click on the notepad and run as admin.
  • Now select the file and click open
  • Head over to C:WindowsSystem32driversetc folder
  • And change Text Documents (*.txt) to All Files
  • Now choose hosts and open it
  • Make the desired changes and save them

Copy host files to a different location:

  • Head over to C:WindowsSystem32driversetc folder and look for host files
  • Copy the files to Desktop
  • Now open files with notepad
  • Make the desired changes and move the files back to C:WindowsSystem32driversetc folder

Change the settings if hosts set to read-only:

  • Head over to C:WindowsSystem32driversetc and look for host files
  • Then click on properties
  • Now head over to the Attributes section and deselect the option read-only
  • Click apply and ok to save changes

Conclusion:
By now, you’ll be successful in solving the issue on your computers. However, if it wasn’t possible, and you used another method to fix this issue, then let us know in the comments below.

Leave a Reply

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