Many users have reported being Unable to Edit Hosts File due to “Access Denied” message when editing Hosts File in Windows 10.
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.
1. Click on the Start button > type Note in the Search box > right-click on Notepad and select Run as Administrator option.
2. On the next screen, type your Admin Password and press the Enter key.
3. Once Notepad opens, select the File tab and click on Open.
4. 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.
6. 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.
1. Using File Explorer, navigate to C:\Windows\System32\drivers\etc\ .
2. Select the Hosts File and drag it to the Desktop.
3. Click on Continue on “File Access Denied” pop-up,
4. On the next screen, enter your Admin Password and press the Enter key.
5. Open Hosts File on your desktop using Notepad and make changes as required.
4. After making changes, drag Hosts File back to C:\Windows\System32\drivers\etc\
5. Click on Continue on “Destination Folder Access Denied” pop-up,
6. 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.
1. Using File Explorer, navigate to C:\Windows\System32\drivers\etc\.
2. Right-click on the Hosts File and click on Properties.
3. On Host Properties screen, uncheck Read-only Box in Attributes section.
4. 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.