PC Review


Reply
Thread Tools Rate Thread

i can't modified the host file.

 
 
=?Utf-8?B?UC5KLg==?=
Guest
Posts: n/a
 
      9th Jul 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
 
      9th Jul 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
 
      9th Jul 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." <(E-Mail Removed)> wrote in message
news:87CD57E5-D110-42D4-96AE-(E-Mail Removed)...
>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
 
=?Utf-8?B?UC5KLg==?=
Guest
Posts: n/a
 
      9th Jul 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
Rate This Thread
Rate This Thread:

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
Extracting date file modified from a text file. webels Microsoft Excel Programming 4 19th Apr 2010 09:52 PM
Is the .NET configuration file cache not refreshed when the sourceconfig file is modified? Water Cooler v2 Microsoft C# .NET 1 24th Sep 2009 05:18 AM
Help: Dynamically set host file per user rather than per host? Brent Windows XP Setup 1 5th Jun 2009 04:13 PM
Error accessing file ... on saving an exisitng modified file RM Microsoft Powerpoint 1 4th Aug 2008 01:07 PM
Strange Blue Screen/file modified (not modified) zman Windows XP New Users 2 16th Sep 2003 09:58 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:58 AM.