How can I modify my hosts file? It is read-only and cannot be modified even as Adminstrator.

4

Does anyone know how to modify entries on the hosts file when it is marked as read-only?

I have tried unchecking the Read-only tick box, but I get an Access is Denied error, and I'm running as the Administrator.

Jaime Garcia

Posted 2010-03-27T23:30:04.263

Reputation: 155

Answers

8

Don't edit it in place. Take a copy of it, edit the copy and then replace the original with the edited copy. Doing all this as an administrator of course.

Always a good idea to keep a copy of the original version as well in case you need revert the changes.

Sim

Posted 2010-03-27T23:30:04.263

Reputation: 1 438

1

Is this a personal machine, or in a corporate environment? Is it possible that it's locked down thru SMS so you're not allowed to change it?

chris

Posted 2010-03-27T23:30:04.263

Reputation: 8 607

1

If you are unable to change permissions or attributes on a file you can take ownership of the file to force the changes to be made.

Greg Bray

Posted 2010-03-27T23:30:04.263

Reputation: 1 772