12

I'm trying to edit the hosts file (C:\Windows\System32\drivers\etc\hosts), because I want to setup a local redirect for my website (like I've always done in XP). However, I can't save the changes!

I have taken ownership, I have allowed my account full access and have tweaked every other setting I can think of. Every time I edit and save it, "Access is denied" pops up.

How do I get past this?

3 Answers 3

17

You have to open it with administrative access.

Launch Notepad with Administrative access then re-open the file.

1
  • I just noticed that Avira Antivirus includes protection to avoid modification of system files, you should disable the realtime protection before attempting to save the file and enable it afterward.
    – jhcaiced
    Commented Jul 29, 2014 at 13:56
4

run notepad as administrator by right-clicking on a shortcut to notepad, and then opening the hosts file.

0

Methods\Procedures

  1. Sometimes we need to modify hosts file to achieve your goals. XP OS supports saving it after modify directly. But on Windows 7 OS it prompts you have no permission to modify it.

  2. Open this file in local path c:\windows\system32\drivers\etc.

  3. Then right click on it, select properties option.

  4. In the opened host properties, switch to “Security” tab.

  5. Then click Advanced button.

  6. In the opened window, we select “Change permissions” button.

  7. Check out “Include inheritable permissions from this object’s parent” option, then click Add button.

  8. After click Add button we back to the previous window, click confirm, pops up Windows safe window, click Yes.

  9. Click confirm again, back to host properties window, then we select Administrators and click edit button.

  10. We checked the current user’s management group, to give full control permissions.

  11. Click confirm button, then we can modify hosts file now.

can refer to the link:http://itsprite.com/windows7how-to-save-the-modified-hosts-file-on-windows-7/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .