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.

Possible Duplicate:
How do you edit hosts file on Windows 7

I need to edit the hosts file so that I could restrict some sites from opening. I have tried to open it and edit it but when I save it, Admin privileges error is displayed. Even with admin privileges it doesn't allow me to edit it.

share|improve this question

marked as duplicate by Dennis, BBlake, Randolph West, Dave Rook, Mechanical snail Sep 13 '12 at 12:28

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

add comment

3 Answers

up vote 3 down vote accepted

Microsoft has posted a workaround in a support article, "Modify the Hosts file or the Lmhosts file in Windows Vista and Windows 7".

share|improve this answer
1  
I've just edited Karan's answer to clarify that despite the unfortunate title, this is a link to a workaround, not to an article claiming it simply can't be done. –  Nicole Hamilton Sep 12 '12 at 18:42
    
Ugh, yes, the article provides a workaround. The title is to be interpreted not as "you cannot do it", but as "you cannot do it normally, so here's how". Also, thanks for the edit, Nicole! :) –  Karan Sep 12 '12 at 18:46
    
cool, just a thought, you can create the link to say anything you want of course. Might be a good idea to just change the link text :) –  JoshP Sep 12 '12 at 18:46
    
@Josh: Yep, I know that. Was in a bit of a hurry and so it actually just failed to occur to me that the original title could be misinterpreted. Will be more careful in future. –  Karan Sep 12 '12 at 18:49
add comment

Run your editor as administrator. That way it has permissions to write to the file.

Alternatively: Edit the file, save it in an alternative place and copy ot as administrator.

share|improve this answer
add comment

Open up Notepad with Administrator rights. Then open hosts file with Notepad and you can edit and save it.

share|improve this answer
add comment

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