Help Please : Not able to modify host file


Recommended Posts

Hi,

 

I am trying to add a website address & name to windows "host" file but when trying to save it I get the message that I don't have permission to save in this location & tp contact administrator. This is my personal PC & I am the administrator in user accounts in control panel. No one else has any accounts on this PC.

 

How do I resolve this ?

 

Thanks

Link to comment
Share on other sites

You're editing it in notepad?

Usually should work, try making a copy onto your desktop, modifying it there, then before you put it back, rename the original host file into a .bak extension, then cut the modified file from desktop back in, see how you get along

Failing that, you could try temporarily lowering UAC settings (assuming you're using windows)

Link to comment
Share on other sites

Try running notepad as an administrator.

 

If that doesn't work, do the save a copy to your desktop and then copy it in from explorer as Aheer says.

  • Like 2
Link to comment
Share on other sites

Right-click Notepad and run as Administrator, then open host file from Notepad.  I haven't tried in Windows 8, but that worked in Win 7.

 

You can also give your use permission to edit that file by right-clicking, going to Security, than adding yourself.  I believe that's only in Pro or above, though.  Also with Simple File Sharing turned off.

Link to comment
Share on other sites

Running Win-7 Ultimate (64 bit)

 

Tried both methods, running as an admin but didn't work.

 

Tried Edit add name but came up with a message that " More than one object matched the name. Select one or more names from this list or reenter the name "

 

Haven't tried the desktop method yet though.

Link to comment
Share on other sites

If Shiranui's suggestion does not work, then try this:

 

right-click on that hosts file and select Properties then select security tab

 

and see what permissions it is being used...

 

if you notice that is not writable for that username (the one you are on which is under the Users group), then you can change the permission for that file on that user's account.

 

Once you are done with changing the permissions, go back to the notepad and see if editing and saving work for you.

 

After finish editing that file, go back to security tab and change back to where it was for protection.

Link to comment
Share on other sites

Hello,

Try running notepad as an administrator.

 

If that doesn't work, do the save a copy to your desktop and then copy it in from explorer as Aheer says.

 

search for "notepad"

right-click > run as admin

 

open hosts file from with notepad (as opposed to dragging and dropping it)

These work perfectly. If not, you are doing it wrong ?

If Shiranui's suggestion does not work, then try this:

 

right-click on that hosts file and select Properties then select security tab

 

and see what permissions it is being used...

 

if you notice that is not writable for that username (the one you are on which is under the Users group), then you can change the permission for that file on that user's account.

 

Once you are done with changing the permissions, go back to the notepad and see if editing and saving work for you.

 

After finish editing that file, go back to security tab and change back to where it was for protection.

I dont recommend this because there is a small chance you can potentinally lock yourself out of a file. Changing permission for Windows files to modify them is generally a bad idea.
Link to comment
Share on other sites

I always just add myself to the files security properties and give myself modify writes..

 

Despite what was said, you can't be locked out as long as you are an Administrator, or there is an other admin account on the system.

Link to comment
Share on other sites

I dont recommend this because there is a small chance you can potentinally lock yourself out of a file. Changing permission for Windows files to modify them is generally a bad idea.

I do this all the time. No plm so far. I know what I am doing.

Link to comment
Share on other sites

Adding yourself to the file permissions could potentially be bad. It's in the system folder and if you have permission to edit it by default any malware you might accidentally run could add entries to it silently and open your computer up to more infections. It's best to just copy it and copy it back after editing it.

Link to comment
Share on other sites

Hello,

 

These work perfectly. If not, you are doing it wrong ?

I dont recommend this because there is a small chance you can potentinally lock yourself out of a file. Changing permission for Windows files to modify them is generally a bad idea.

 

You can always re-take ownership of the file if you are logged on as an administrator account.

 

Question is, why is he trying to edit the file and add the entry, is there something else going on with the system?

Link to comment
Share on other sites

Adding yourself to the file permissions could potentially be bad. It's in the system folder and if you have permission to edit it by default any malware you might accidentally run could add entries to it silently and open your computer up to more infections. It's best to just copy it and copy it back after editing it.

 

If you leave writable on, then you have security risk...

 

Like I said before, you can turn writable off after finish editing the file.   No problem.

 

It works for me.

 

Or add an user to that permission with write enabled... then after you finish editing, you can delete that user from that permission. That simple.

 

My computer has not been infected or crashed since I have done this for awhile now.

 

If you know what you are doing, you are fine.

Link to comment
Share on other sites

So this is not hard people

 

Run as admin

 

post-14624-0-97724900-1392817777.png

 

Open file

 

post-14624-0-83893400-1392817794.png

 

Edit file and save

 

post-14624-0-69126800-1392817807.png

 

Works

 

post-14624-0-74305700-1392817820.png

 

Some of the suggestions in this thread are just way out there..

 

 

 

 

  • Like 2
Link to comment
Share on other sites

Sure OK -- some AV software might do that..  I would hope the person wanting to edit their host file would understand their system enough to know that their "security" software is preventing that.  Shouldn't they get a error when trying to save that it was blocked, shouldn't their security software log show attempt to edit host was blocked, etc.

 

So its not very good security software if all I have to do is overwrite the whole file, or change its extension, etc.

 

Nor should security software blocking changes to host file care what the security permissions on the file are.  If "security" software is blocking the access - and any of these methods work its really bad security software ;)

 

Change the setting on your security software to allow the edit, then run notepad as elevated and edit the file - it is that simple.

Link to comment
Share on other sites

My God,

You guys are genius & I am grateful for your suggestions.

Every precautions & consequences you suggested are true.

First my antivirus deleted the host file when I tried to modify & paste it back.

Then somehow I pasted back the original unedited copy..

Now my PC is totally f%#@&d up & whenever I try to  touch something with my mouse, the SOB opens it  & I am afraid to touch anything..

So I am back to reinstall the OS.

What I have learned from all of you is not to fool around with system files. Am I correct ?

Link to comment
Share on other sites

Muck around with system files all you want....in a Virtual Machine, and only if you know what you are doing.

Link to comment
Share on other sites

The host file while a system file, is meant to be edited - but since accounts no longer run with the admin token to edit you must be elevated to have access.  This is for your own protection, so if you run some bad code system files like the host file can not be edited sending you to the wrong place for google or preventing access to antivirus sites, etc. etc..

 

What you should learn from this is understand how to configure your own security software ;)

 

What antivirus are you using btw?

Link to comment
Share on other sites

Hello,

So this is not hard people

 

Run as admin

 

 

Open file

 

Edit file and save

 

Works

 

Some of the suggestions in this thread are just way out there..

[sarcasm]

No, he needs to rip everything except his RAM, CPU, Mouse (no keyboard, security risk), PSU, and the HDD containing the hosts file out of his PC. Then boot up a LiveUSB like Tails and make a VM inside of that of Tails also and using vi rewrite his entire hosts file using a on-screen keyboard.

Its the only to be sure, BudMan

[/sarcasm]

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.