Jump to content



Photo

Help Please : Not able to modify host file


  • Please log in to reply
21 replies to this topic

#1 dan99t

dan99t

    Neowinian

  • Joined: 30-November 11

Posted 19 February 2014 - 05:49

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




#2 +Aheer.R.S.

Aheer.R.S.

    I cannot Teach Him, the Boy has no Patience!

  • Tech Issues Solved: 8
  • Joined: 15-October 10
  • Location: Wolverhampton, United Kingdom
  • OS: Windows 7 X64 Ultimate Edition
  • Phone: Sony Xperia Z1 Compact

Posted 19 February 2014 - 05:52

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)



#3 BannanaNinja

BannanaNinja

    Neowinian

  • Joined: 14-February 11
  • Location: US
  • OS: Windows 8.1
  • Phone: Windows Phone 8

Posted 19 February 2014 - 05:58

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.



#4 farmeunit

farmeunit

    The other white meat.

  • Tech Issues Solved: 2
  • Joined: 05-May 03
  • Location: Branson, MO USA

Posted 19 February 2014 - 05:58

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.



#5 OP dan99t

dan99t

    Neowinian

  • Joined: 30-November 11

Posted 19 February 2014 - 07:26

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.



#6 0nyX

0nyX

    Posting from Apple //c

  • Joined: 07-April 09
  • Location: C:\Users\OnyX

Posted 19 February 2014 - 07:31

- Copy your hosts file to desktop

- Edit the hosts file you just copied

- Paste and replace the hosts file you just edited, from desktop to drivers/etc/.



#7 Shiranui

Shiranui

    Iconoclast

  • Tech Issues Solved: 1
  • Joined: 24-December 03

Posted 19 February 2014 - 07:38

search for "notepad"

right-click > run as admin

 

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



#8 shozilla

shozilla

    Neowinian Senior

  • Tech Issues Solved: 6
  • Joined: 11-January 09

Posted 19 February 2014 - 07:55

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.



#9 +riahc3

riahc3

    Neowin's most indecisive member

  • Tech Issues Solved: 11
  • Joined: 09-April 03
  • Location: Spain
  • OS: Windows 7
  • Phone: HTC Desire Z

Posted 19 February 2014 - 08:56

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.

#10 Ryoken

Ryoken

    The Other Other White Meat

  • Joined: 10-September 09
  • Location: Nova Scotia, Canada
  • OS: Windows 7 x64, MacOS
  • Phone: iPhone 4S, Nexus 7, iPad Mini

Posted 19 February 2014 - 09:25

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.



#11 shozilla

shozilla

    Neowinian Senior

  • Tech Issues Solved: 6
  • Joined: 11-January 09

Posted 19 February 2014 - 11:32

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.

#12 Eric

Eric

    Neowinian Senior

  • Tech Issues Solved: 11
  • Joined: 02-August 06
  • Location: Greenville, SC

Posted 19 February 2014 - 13:23

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.

#13 Steven P.

Steven P.

    aka Neobond

  • Tech Issues Solved: 56
  • Joined: 09-July 01
  • Location: Neowin HQ

Posted 19 February 2014 - 13:28

Pretty sure you can't modify files within system32, do what others are suggesting, copy to desktop, modify, copy back, which does work.



#14 xendrome

xendrome

    In God We Trust; All Others We Monitor

  • Tech Issues Solved: 8
  • Joined: 05-December 01
  • OS: Windows 8.1 Pro x64

Posted 19 February 2014 - 13:31

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?



#15 shozilla

shozilla

    Neowinian Senior

  • Tech Issues Solved: 6
  • Joined: 11-January 09

Posted 19 February 2014 - 13:47

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.





Click here to login or here to register to remove this ad, it's free!