• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 412
  • Last Modified:

hosts file

I cannot edit hosts file in windows

in

cd:/windows/system32/drivers/etc/hosts

I want to edit and save

Unfortunately I cannot save.
0
walkerdba
Asked:
walkerdba
1 Solution
 
MattyS82Commented:
What are the permissions on the file? Do you have the rights to edit the file?

This might be of assistance;

http://answers.microsoft.com/en-us/windows/forum/windows_7-files/windows7-will-not-let-me-edit-the-hosts-file-and/9cede7a3-1908-4606-a955-64a9b4872fd7
0
 
tailoreddigitalCommented:
Are you getting an error?

You should be able to open it in Notepad and edit, save.
0
 
Rob MinersCommented:
It has to be opened elevated.

Click Start, click All Programs, click Accessories, right click Notepad and then click, Run as administrator.
If you are prompted for an administrator password or for a confirmation, type the password or Click OK or Yes to the UAC prompt.

Click File Open, in the dropdown box bottom right change Text Documents (*.txt) to All Files (*.*) and Navigate to C:\Windows\System32\drivers\etc\hosts
Open the Hosts file, make the necessary changes, and then click Save on the File menu.
0
 
Darr247Commented:
You have to take ownership of the file, at least... C:\Windows and deeper is owned by TrustedInstaller by default in Win7 (I'm assuming you're talking about Win7... you never mentioned what OS you have). Most people will never edit anything in there, but when you need to do something manually, take ownership and give the new owner (i.e. your username) proper permissions (e.g. Full Control) on the Permissions tab.

For this case, I recommend taking ownership (and giving Full Control permission) of just the etc subdir and its contents.

MS TechNet instructions - How to Take Ownership of Files and/or Folders

Don't forget to stop on the Permissions tab after taking ownership, click the Change Permissions... button, select your username, then check the Full Control box (which should also check all the rest of the boxes there).Take Ownership of %windir%\system32\drivers\etc Subdir
0
 
walkerdbaAuthor Commented:
yes
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now