Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista Hardware > i can't modified the host file.

Reply
Thread Tools Display Modes

i can't modified the host file.

 
 
P.J.
Guest
Posts: n/a

 
      07-09-2007
i tried to modified to add IP local host on my system. but there is an error
message prompt "Cannot create the C:\Windows\System32\drivers\etc\hosts
file." - "Make sure that the path and filename are correct"

How to solve this?

PJ
 
Reply With Quote
 
 
 
 
Malke
Guest
Posts: n/a

 
      07-09-2007
P.J. wrote:
> i tried to modified to add IP local host on my system. but there is an error
> message prompt "Cannot create the C:\Windows\System32\drivers\etc\hosts
> file." - "Make sure that the path and filename are correct"
>
> How to solve this?
>
> PJ


I have some notes on doing this from a newsletter by Mark Minasi:

"The HOSTS file is in the same place that it's always been in Windows:
\windows\system32\drivers\etc. But that directory has a different set
of NTFS permissions than Windows has ever seen, as by default
administrators can't delete files, nor do they own those files. You can
give yourself enough control of HOSTS to modify it by first taking
ownership of it, then granting yourself full control to HOSTS. That's
most easily done from an elevated command prompt.

"(Note: an "elevated command prompt" means that you right-click the
Command Prompt icon and choose "Run as administrator," and then click
"Confirm" when you get the User Account Control prompt.)

"From the elevated command prompt, type these two lines:

takeown /f c:\windows\system32\drivers\etc\hosts
icacls c:\windows\system32\drivers\etc\hosts /grant yourusername:f

"Those are two new Vista command-line tools. The first lets you take
ownership of a file or folder, as its name suggests. That line that you
typed is the simplest form of takeown: just add a "/f" and the name of
the file or folder to take ownership of. (Takeown even lets you take
ownership of things on remote systems, which can be convenient.) The
second command lets you adjust NTFS permissions and file/folder
integrity levels -- it's intended to be the replacement for cacls, which
has been around since NT 3.1, and its syntax closely mirrors cacls's.
In that command, I'm using the /grant option to allow me to give the
account "yourusername" full control; that's what the "F" stands for."

Hope that helps,


Malke
--
Elephant Boy Computers
www.elephantboycomputers.com
"Don't Panic!"
MS-MVP Windows - Shell/User
 
Reply With Quote
 
Michael
Guest
Posts: n/a

 
      07-09-2007
Run notepad 'as administrator'
open the file, make changes and save.

Making the changes in notepad for instance without elevating to 'run as
administrator' gives the error message you report.

Michael
Vista home premium


"P.J." <> wrote in message
news:87CD57E5-D110-42D4-96AE-...
>i tried to modified to add IP local host on my system. but there is an
>error
> message prompt "Cannot create the C:\Windows\System32\drivers\etc\hosts
> file." - "Make sure that the path and filename are correct"
>
> How to solve this?
>
> PJ


 
Reply With Quote
 
P.J.
Guest
Posts: n/a

 
      07-09-2007
Thanks GUYS, it works!

"Malke" wrote:

> P.J. wrote:
> > i tried to modified to add IP local host on my system. but there is an error
> > message prompt "Cannot create the C:\Windows\System32\drivers\etc\hosts
> > file." - "Make sure that the path and filename are correct"
> >
> > How to solve this?
> >
> > PJ

>
> I have some notes on doing this from a newsletter by Mark Minasi:
>
> "The HOSTS file is in the same place that it's always been in Windows:
> \windows\system32\drivers\etc. But that directory has a different set
> of NTFS permissions than Windows has ever seen, as by default
> administrators can't delete files, nor do they own those files. You can
> give yourself enough control of HOSTS to modify it by first taking
> ownership of it, then granting yourself full control to HOSTS. That's
> most easily done from an elevated command prompt.
>
> "(Note: an "elevated command prompt" means that you right-click the
> Command Prompt icon and choose "Run as administrator," and then click
> "Confirm" when you get the User Account Control prompt.)
>
> "From the elevated command prompt, type these two lines:
>
> takeown /f c:\windows\system32\drivers\etc\hosts
> icacls c:\windows\system32\drivers\etc\hosts /grant yourusername:f
>
> "Those are two new Vista command-line tools. The first lets you take
> ownership of a file or folder, as its name suggests. That line that you
> typed is the simplest form of takeown: just add a "/f" and the name of
> the file or folder to take ownership of. (Takeown even lets you take
> ownership of things on remote systems, which can be convenient.) The
> second command lets you adjust NTFS permissions and file/folder
> integrity levels -- it's intended to be the replacement for cacls, which
> has been around since NT 3.1, and its syntax closely mirrors cacls's.
> In that command, I'm using the /grant option to allow me to give the
> account "yourusername" full control; that's what the "F" stands for."
>
> Hope that helps,
>
>
> Malke
> --
> Elephant Boy Computers
> www.elephantboycomputers.com
> "Don't Panic!"
> MS-MVP Windows - Shell/User
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
corrupt windows host process file ???? NURSEASHLEYN Windows Vista General Discussion 3 03-12-2008 10:22 AM
Date modified of a file doesn't update to the most recent TonyC Windows Vista General Discussion 0 09-15-2007 02:26 PM
Ever wondered what the 102.54.94.97 rhino.acme.com and 38.25.63.10 x.acme.com IS DOING IN YOUR 'HOST' FILE.....Just a 'Harmless example' or backdoor for the CIA.!!!! Big Ben Windows Vista General Discussion 6 07-12-2007 08:35 PM
File Sharing (invalid Host name) File Sharing (invalid host name) Windows Vista Networking 2 06-01-2007 10:19 AM
Host file JB Windows Vista Security 4 05-24-2007 09:49 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59