How to Fix Notepad “Access Denied” When Editing Hosts File on Windows?

by Linas Kiguolis - -
12

Question

Issue: How to Fix Notepad “Access Denied” When Editing Hosts File on Windows?

I need to edit hosts file, but each time I try to do that I get a Notepad error “Access is denied.” Did not try any fixes yet. Could you recommend something?

Fix it now! Fix it now!
The free scanner will identify main causes of your problem in its scan report. To eliminate them, you have to activate the licensed version of Reimage repair software by purchasing it. To repair damaged system, you have to purchase the licensed version of Reimage Reimage.

Solved Answer

Hosts file is a text file located inside the Windows OS folder and can be used to block particular sites. Sometimes, due to virus attack or other reasons, people might want to edit the hosts file to have a normal access to the websites and network traffic.

Before the emergence of the DNS, hosts files have been used for resolving hosts names. These files have a distinct syntax, which is easily recognizable on every operating system, including Windows, macOS or Linux. Therefore, the modification of hosts file should be initiated in a very careful manner to prevent file damage. Unfortunately, but both inexperienced and advanced PC users may not be allowed to edit hosts file. Few people have reported “Access is denied” Notepad error when trying to edit hosts files on Windows 10.

Instructing how to fix

In most of the cases, the “Access is denied” error aborts editing hosts file due to the fact that the user does not have permission. The hosts file is located in Windows installation directory, also known as root drive. The file is protected from unauthorized access, so if you’re not an authorized user of the target PC, you may encounter “Access is denied” error on Notepad. Luckily, the problem can be fixed quite easily.

Fixing “Access is denied” error when editing hosts file on Windows 10

Launch Notepad as administrator

If you are using Notepad for editing hosts file, but the app returns the “Access is denied” pop-up, try to launch it as administrator:

  1. Open Windows search and type Notepad.
  2. Right-click on Notepad option and select Run as administrator.
  3. When the tool opens, select File -> Open.
  4. Navigate to the C:\\Windows\\System32\\drivers\\etc folder and make sure to change Text Documents (*.txt) to All Files.
  5. Select hosts file and click Open.
  6. Edit the hosts file and save it.

Run Notepad using Command Prompt

  1. Right-click Windows key and select Command Prompt (Admin).
  2. Copy and paste the following commands into the Command Prompt window and press Enter after each:
    cd C:\\Windows\\System32\\drivers\\etc
    notepad hosts
  3. Make the changes to the hosts file, save them and close Command Prompt.

Transfer hosts file to another location

To fix “Access denied” alert while editing hosts file, try to move hosts file to a different location. Then edit it and move back to the initial location:

  1. Navigate to the C:\\Windows\\System32\\drivers\\etc and find your hosts file.
  2. Copy it to a different location, for example Desktop or any folder out of the Windows install directory.
  3. Then open the hosts file with Notepad and modify it.
  4. Save the changes. Then cut the file and paste it back to the C:\\Windows\\System32\\drivers\\etc directory.

Unmark Read-only option

Hosts file is set to Read-only by default. It means that the file cannot be edited in a regular way. To get permission to modify it, you should:

  1. Navigate to the C:\\Windows\\System32\\drivers\\etc directory.
  2. Find your hosts file, right-click it, and select Properties.
  3. Open Attributes section and uncheck the Read-only option.
  4. Click Apply and OK to save changes.

Modify hosts file’s security settings

  1. Navigate to the C:\\Windows\\System32\\drivers\\etc directory.
  2. Find your hosts file, right-click it, and select Properties.
  3. Open Security tab and click Edit.
  4. Check the list of users that have access to hosts file. If your user name is included in that list, click it and set Permissions to Full control.
  5. If your user name is not included in that list, click the Add button and enter your user name.
  6. Click Check Names and hit OK.
  7. Now your user name should be added to the list. Click it and mark the Full control open next to your name.
  8. Click Apply and OK to save the changes.

Repair your Errors automatically

ugetfix.com team is trying to do its best to help users find the best solutions for eliminating their errors. If you don't want to struggle with manual repair techniques, please use the automatic software. All recommended products have been tested and approved by our professionals. Tools that you can use to fix your error are listed bellow:

We might be affiliated with any product we recommend on the site. Full disclosure in our Agreement of Use. By Downloading any provided software you agree to our privacy policy and agreement of use.
do it now!
Download
repair software Happiness
Guarantee
do it now!
Download
repair software Happiness
Guarantee
Compatible with Microsoft Windows Compatible with OS X
Still having problems?
If you failed to fix your error using Reimage, reach our support team for help. Please, let us know all details that you think we should know about your problem.
Reimage - a patented specialized Windows repair program. It will diagnose your damaged PC. It will scan all System Files, DLLs and Registry Keys that have been damaged by security threats.Reimage - a patented specialized Mac OS X repair program. It will diagnose your damaged computer. It will scan all System Files and Registry Keys that have been damaged by security threats.
This patented repair process uses a database of 25 million components that can replace any damaged or missing file on user's computer.
To repair damaged system, you have to purchase the licensed version of Reimage malware removal tool.

What you can add more about the problem: "How to Fix Notepad “Access Denied” When Editing Hosts File on Windows?"

Ask
now online
news
Subscribe
Fix
Uninstall
Optimize
Recover
Like us on Facebook