How do you edit hosts file on Windows 7

12

1

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?

Keith Barrows

Posted 2009-09-30T17:22:36.977

Reputation: 223

Answers

17

You have to open it with administrative access.

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

Ryan Kearney

Posted 2009-09-30T17:22:36.977

Reputation: 371

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 – 2014-07-29T13:56:13.977

4

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

Justin Grant

Posted 2009-09-30T17:22:36.977

Reputation: 338

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/

user269562

Posted 2009-09-30T17:22:36.977

Reputation: 1