Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
add comment

migrated from stackoverflow.com Sep 30 '09 at 17:24

This question came from our site for professional and enthusiast programmers.

3 Answers

up vote 15 down vote accepted

You have to open it with administrative access.

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

share|improve this answer
    
You should accept this answer @Keith Barrows –  Kyle Sevenoaks Mar 24 '11 at 9:40
add comment

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

share|improve this answer
add comment

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/

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.