3 Methods To Avoid “Notepad: Access Is Denied” While Editing Hosts File On Windows 10

Many Windows 10 users have reported that Notepad say “Access is denied” when trying to edit hosts file on Windows 10.

Notepad Access is denied

Notepad: Access is denied

Hosts file is one of the system files. It’s protected from unauthorized access. However, if you need to edit hosts file, you can get rid of “Notepad: Access is denied” error message by following one of my methods.

How to Fix “Notepad: Access Is Denied” While Editing Hosts File In Windows 10

Method 1. Run Notepad as Administrator to Avoid Access is Denied

If you are trying to edit the hosts file in Windows 10 but Notepad say was denied, I highly recommended you run Notepad as Administrator before you edit the hosts file. To do that, follow these steps below:

Step 1. Press Windows Key + S then type Notepad in the search box.
Step 2. When Notepad appears in the list of results, you right-click it and select Run as administrator.

run Notepad as Administrator
Step 3. When Notepad opens, click File > Open.
Step 4. Then you go to C:\Windows\System32\drivers\etc folder.

Choose hosts and select Open.

Run Notepad as Administrator to Avoid Access is Denied

Note: Make sure that you changed Text Documents (*.txt) to All Files.

Now you can easily edit the hosts file and save it in Windows 10.

Method 2. Copy the hosts file to your Desktop

According to Windows 10 users, you can get rid of “Notepad: Access is denied” error message while trying to edit hosts file simply by moving the file to a different location, editing it and moving it back to the original location. To do that, follow these steps below:

Step 1. Navigate to C:\Windows\System32\drivers\etc and find hosts file.
Step 2. Copy it to any other folder or your Desktop.
Step 3. Using Notepad to open the hosts file on your Desktop.
Step 4. Now, you make the necessary changes and copy the hosts file back to C:\Windows\System32\drivers\etc directory.

Method 3. Change the security settings for hosts

Step 1. Go to C:\Windows\System32\drivers\etc.
Step 2. Then you find the hosts file, right-click it and select Properties.
Step 3. In Attributes section, make sure Read-only option isn’t checked. Click Apply to save changes.


Step 4. Now, you switch to Security tab and click Edit button.
Step 5. You will see the list of users and groups on your computer that have access to hosts file.

If your user name or group is on the list, select it and ensure that it has Permissions set to Full control.

If your user name or group isn’t on the list, click the Add button.

  • In the Enter the object names to select field, type the user name or the group name.
  • Click Check Names and click OK to add new user or group to the list.
  • Next, you need to select the newly added group or user and check the Full control option.

You can watch this video below to learn more how to fix error ”Acces is denied” while editing Notepad files:

That’s it.