Access Denied When Editing Hosts File in Windows 10
The Hosts File in Windows 10 can be used by malware programs to block access to certain websites or to redirect users to unsafe websites. Hence, the Hosts File is protected from unauthorized access and it can only be edited by Users with Admin privileges. However, it is possible to Edit Hosts File without getting “Access Denied” message by following one of the methods as provided below.
1. Run Notepad as Admin
In most cases, you should be able to Edit Hosts File by using Notepad with Admin Privileges.
Click on the Start button > type Note in the Search box > right-click on Notepad and select Run as Administrator option.
On the next screen, type your Admin Password and press the Enter key.
Once Notepad opens, select the File tab and click on Open.
In Open File dialogue box, navigate to C:\Windows\system32\drivers\etc and switch to All Files view.
Note: You won’t be able to view Hosts File without switching to All Files view. 5. Select the Hosts File and click on the Open button to open Hosts File in Notepad.
- Make changes as required to the hosts file and Save the file.
2. Edit Hosts File on Desktop
Another way is to move the Hosts File to Desktop, make changes and move the Edited File back to its original location.
Using File Explorer, navigate to C:\Windows\System32\drivers\etc\ .
Select the Hosts File and drag it to the Desktop.
Click on Continue on “File Access Denied” pop-up,
On the next screen, enter your Admin Password and press the Enter key.
Open Hosts File on your desktop using Notepad and make changes as required.
After making changes, drag Hosts File back to C:\Windows\System32\drivers\etc\
Click on Continue on “Destination Folder Access Denied” pop-up,
On the next screen, enter your Admin Password to move the File back to its original destination.
3. Uncheck Read Only Box
It is possible that Hosts File has been saved in Read Only mode.
Using File Explorer, navigate to C:\Windows\System32\drivers\etc.
Right-click on the Hosts File and click on Properties.
On Host Properties screen, uncheck Read-only Box in Attributes section.
Click on Apply & OK to save the changes. If you are still unable to Edit Hosts files, you need to scan your computer for malware and see if this helps. If you are unable to Edit Hosts File in Windows 10 and seeing “Access Denied” message, the problem is usually due to lack of User Permissions.
How to See Hidden System Files in Windows 10 How to Change Ownership of File or Folder in Windows 10