A Windows XP help forum. PCbanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » PCbanter forum » Microsoft Windows 7 » Windows 7 Forum
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

can't edit hosts file?



 
 
Thread Tools Rate Thread Display Modes
  #1  
Old April 5th 18, 08:04 PM posted to alt.windows7.general
J. P. Gilliver (John)[_4_]
external usenet poster
 
Posts: 2,679
Default can't edit hosts file?

I'm sure I have edited it since moving to W7! But now when I try, I am
told it is in use: "The process cannot access the file because it is
being used by another process." (The process being plain original
NotePad.) If I try to delete it (having made a copy of course!), I get
"The action can't be completed because the file is open in System".

I've just done a restart, and tried again before opening anything I'd
have thought would be using it - no change. Though as I said, I'm sure
I've edited it before, and that _wouldn't_ have been under those
circumstances.

What's using it? "System" isn't very informative - could be a user
rather than a process.
--
J. P. Gilliver. UMRA: 1960/1985 MB++G()AL-IS-Ch++(p)Ar@T+H+Sh0!:`)DNAf

A man is not contemptible because he thinks science explains everything, and a
man is not contemptible because he doesn't. - Howard Jacobson, in Radio Times
2010/1/23-29.
Ads
  #2  
Old April 5th 18, 09:35 PM posted to alt.windows7.general
Char Jackson
external usenet poster
 
Posts: 10,449
Default can't edit hosts file?

On Thu, 5 Apr 2018 20:04:01 +0100, "J. P. Gilliver (John)"
wrote:

I'm sure I have edited it since moving to W7! But now when I try, I am
told it is in use: "The process cannot access the file because it is
being used by another process." (The process being plain original
NotePad.) If I try to delete it (having made a copy of course!), I get
"The action can't be completed because the file is open in System".

I've just done a restart, and tried again before opening anything I'd
have thought would be using it - no change. Though as I said, I'm sure
I've edited it before, and that _wouldn't_ have been under those
circumstances.

What's using it? "System" isn't very informative - could be a user
rather than a process.


Some AV programs will lock the hosts file to prevent malicious editing.
Also, I believe you have to run your editor, Notepad in this case, as
Administrator. If you're already aware of those restrictions, then I'm
not sure what the deal is.

--

Char Jackson
  #3  
Old April 5th 18, 09:59 PM posted to alt.windows7.general
J. P. Gilliver (John)[_4_]
external usenet poster
 
Posts: 2,679
Default can't edit hosts file?

In message , Char Jackson
writes:
On Thu, 5 Apr 2018 20:04:01 +0100, "J. P. Gilliver (John)"
wrote:

I'm sure I have edited it since moving to W7! But now when I try, I am
told it is in use: "The process cannot access the file because it is
being used by another process." (The process being plain original
NotePad.) If I try to delete it (having made a copy of course!), I get
"The action can't be completed because the file is open in System".

I've just done a restart, and tried again before opening anything I'd
have thought would be using it - no change. Though as I said, I'm sure
I've edited it before, and that _wouldn't_ have been under those
circumstances.

What's using it? "System" isn't very informative - could be a user
rather than a process.


Some AV programs will lock the hosts file to prevent malicious editing.
Also, I believe you have to run your editor, Notepad in this case, as
Administrator. If you're already aware of those restrictions, then I'm
not sure what the deal is.

I've tried this - running Notepad as administrator, and turning off AVG.
I still get "...cannot access the file because it is being used by
another process."
--
J. P. Gilliver. UMRA: 1960/1985 MB++G()AL-IS-Ch++(p)Ar@T+H+Sh0!:`)DNAf

Capital flows toward lower costs like a river to lowest ground.
"MJ", 2015-12-05
  #4  
Old April 5th 18, 10:02 PM posted to alt.windows7.general
Auric__
external usenet poster
 
Posts: 295
Default can't edit hosts file?

Char Jackson wrote:

On Thu, 5 Apr 2018 20:04:01 +0100, "J. P. Gilliver (John)"
wrote:

I'm sure I have edited it since moving to W7! But now when I try, I am
told it is in use: "The process cannot access the file because it is
being used by another process." (The process being plain original
NotePad.) If I try to delete it (having made a copy of course!), I get
"The action can't be completed because the file is open in System".

I've just done a restart, and tried again before opening anything I'd
have thought would be using it - no change. Though as I said, I'm sure
I've edited it before, and that _wouldn't_ have been under those
circumstances.

What's using it? "System" isn't very informative - could be a user
rather than a process.


Some AV programs will lock the hosts file to prevent malicious editing.
Also, I believe you have to run your editor, Notepad in this case, as
Administrator. If you're already aware of those restrictions, then I'm
not sure what the deal is.


If you have Sysinternals Process Explorer, search for "hosts" (Ctrl+F) and
it'll show you what has it open. You can close the handle from the lower main
pane (Ctrl+L). (You may need to "Show Details for All Processes".)

(Any program with similar capabilities should be able to do this.)

Otherwise, try rebooting to safe mode and editing there.

--
Your anger is a wellspring. You must use it.
  #5  
Old April 5th 18, 10:13 PM posted to alt.windows7.general
Ed Cryer
external usenet poster
 
Posts: 2,621
Default can't edit hosts file?

J. P. Gilliver (John) wrote:
In message , Char Jackson
writes:
On Thu, 5 Apr 2018 20:04:01 +0100, "J. P. Gilliver (John)"
wrote:

I'm sure I have edited it since moving to W7! But now when I try, I am
told it is in use: "The process cannot access the file because it is
being used by another process." (The process being plain original
NotePad.) If I try to delete it (having made a copy of course!), I get
"The action can't be completed because the file is open in System".

I've just done a restart, and tried again before opening anything I'd
have thought would be using it - no change. Though as I said, I'm sure
I've edited it before, and that _wouldn't_ have been under those
circumstances.

What's using it? "System" isn't very informative - could be a user
rather than a process.


Some AV programs will lock the hosts file to prevent malicious editing.
Also, I believe you have to run your editor, Notepad in this case, as
Administrator. If you're already aware of those restrictions, then I'm
not sure what the deal is.

I've tried this - running Notepad as administrator, and turning off AVG.
I still get "...cannot access the file because it is being used by
another process."


Try using Process Explorer to see what's got it tied up; Find tab, Find
Handle or DLL.
In Windows 7 the hosts file is;
C:\Windows\System32\drivers\etc\hosts

Ed

  #6  
Old April 5th 18, 10:22 PM posted to alt.windows7.general
Good Guy[_2_]
external usenet poster
 
Posts: 3,354
Default can't edit hosts file?

On 05/04/2018 20:04, J. P. Gilliver (John) wrote:


could be a user rather than a process.


Yes it's a user who has very serious demented brain.

To edit a host file you need to drag it to your desktop (i.e. move it)
and then edit it. after editing it, drag it back to its original location.

Voila it works. It wasn't difficult was it, old man?


/--- This email has been checked for viruses by
Windows Defender software.
//https://www.microsoft.com/en-gb/windows/comprehensive-security/






--
With over 600 million devices now running Windows 10, customer
satisfaction is higher than any previous version of windows.

  #7  
Old April 6th 18, 12:53 AM posted to alt.windows7.general
J. P. Gilliver (John)[_4_]
external usenet poster
 
Posts: 2,679
Default can't edit hosts file?

In message 23,
Auric__ writes:
Char Jackson wrote:

On Thu, 5 Apr 2018 20:04:01 +0100, "J. P. Gilliver (John)"
wrote:

I'm sure I have edited it since moving to W7! But now when I try, I am
told it is in use: "The process cannot access the file because it is
being used by another process." (The process being plain original
NotePad.) If I try to delete it (having made a copy of course!), I get
"The action can't be completed because the file is open in System".

I've just done a restart, and tried again before opening anything I'd
have thought would be using it - no change. Though as I said, I'm sure
I've edited it before, and that _wouldn't_ have been under those
circumstances.

What's using it? "System" isn't very informative - could be a user
rather than a process.


Some AV programs will lock the hosts file to prevent malicious editing.
Also, I believe you have to run your editor, Notepad in this case, as
Administrator. If you're already aware of those restrictions, then I'm
not sure what the deal is.


If you have Sysinternals Process Explorer, search for "hosts" (Ctrl+F) and
it'll show you what has it open. You can close the handle from the lower main
pane (Ctrl+L). (You may need to "Show Details for All Processes".)

(Any program with similar capabilities should be able to do this.)

Otherwise, try rebooting to safe mode and editing there.

Thanks, you and Ed. Excellent idea. Then I found my Process Explorer
won't work! I've extracted it again from the .zip file I downloaded (and
yes, it _did_ work then!); I run it, I get the UAC popup, I click Run in
that, and - nothing happens. And there's nothing beginning with P in
Task Manager other than Panorama.
--
J. P. Gilliver. UMRA: 1960/1985 MB++G()AL-IS-Ch++(p)Ar@T+H+Sh0!:`)DNAf

.... "Peter and out." ... "Kevin and out." (Link episode)
  #8  
Old April 6th 18, 02:18 AM posted to alt.windows7.general
Bob_S[_2_]
external usenet poster
 
Posts: 149
Default can't edit hosts file?

"J. P. Gilliver (John)" wrote in message
...

I'm sure I have edited it since moving to W7! But now when I try, I am told
it is in use: "The process cannot access the file because it is being used
by another process." (The process being plain original NotePad.) If I try
to delete it (having made a copy of course!), I get "The action can't be
completed because the file is open in System".

I've just done a restart, and tried again before opening anything I'd have
thought would be using it - no change. Though as I said, I'm sure I've
edited it before, and that _wouldn't_ have been under those circumstances.

What's using it? "System" isn't very informative - could be a user rather
than a process.


Are you sure you have enabled hidden files and that you have the correct
HOSTS file (uppercase and no extension).

It is in the C:\Windows\System32\drivers\etc directory. You may have other
hosts or HOSTS.xxx files with some extension.

--


Bob S.

  #9  
Old April 6th 18, 02:28 AM posted to alt.windows7.general
J. P. Gilliver (John)[_4_]
external usenet poster
 
Posts: 2,679
Default can't edit hosts file?

In message , Bob_S writes:
"J. P. Gilliver (John)" wrote in message
...

I'm sure I have edited it since moving to W7! But now when I try, I am
told it is in use: "The process cannot access the file because it is

[]
What's using it? "System" isn't very informative - could be a user
rather than a process.


Are you sure you have enabled hidden files and that you have the
correct HOSTS file (uppercase and no extension).


Yes; because it's in such an obscure place and has no extension, I have
a shortcut set up, that opens NotePad+ directly on it. (I don't think
the case matters for such a short filename ...

It is in the C:\Windows\System32\drivers\etc directory. You may have
other hosts or HOSTS.xxx files with some extension.

.... but it's the only hosts file in there anyway.) I _have_ edited it
before; that's why I set up the shortcut.
--
J. P. Gilliver. UMRA: 1960/1985 MB++G()AL-IS-Ch++(p)Ar@T+H+Sh0!:`)DNAf

Old professors don't fade away - they just lose their faculties.
  #10  
Old April 6th 18, 04:25 AM posted to alt.windows7.general
Auric__
external usenet poster
 
Posts: 295
Default can't edit hosts file?

Bob_S wrote:

Are you sure you have enabled hidden files and that you have the correct
HOSTS file (uppercase and no extension).


As a general rule, Windows isn't case-sensitive. It shouldn't matter if it's
"hosts" or "HOSTS" or even something silly like "HoStS".

--
I've come for knowledge.
  #11  
Old April 6th 18, 05:18 AM posted to alt.windows7.general
Char Jackson
external usenet poster
 
Posts: 10,449
Default can't edit hosts file?

On Fri, 6 Apr 2018 03:25:29 -0000 (UTC), "Auric__"
wrote:

Bob_S wrote:

Are you sure you have enabled hidden files and that you have the correct
HOSTS file (uppercase and no extension).


As a general rule, Windows isn't case-sensitive. It shouldn't matter if it's
"hosts" or "HOSTS" or even something silly like "HoStS".


Agreed, and for the record, the default is lower case for this file. I'm
not sure why Bob mentioned uppercase.

--

Char Jackson
  #12  
Old April 6th 18, 06:00 AM posted to alt.windows7.general
Auric__
external usenet poster
 
Posts: 295
Default can't edit hosts file?

Char Jackson wrote:

On Fri, 6 Apr 2018 03:25:29 -0000 (UTC), "Auric__"
wrote:

Bob_S wrote:

Are you sure you have enabled hidden files and that you have the
correct HOSTS file (uppercase and no extension).


As a general rule, Windows isn't case-sensitive. It shouldn't matter if
it's "hosts" or "HOSTS" or even something silly like "HoStS".


Agreed, and for the record, the default is lower case for this file.


It's lowercase in systems that *are* case-sensitive. Both my Mac and my Linux
server have /etc/hosts.

I'm not sure why Bob mentioned uppercase.


In older systems -- 9x and NT3/4 -- the sample hosts files were uppercase.
(HOSTS.SAM) Shrug.

--
You love me 'cause I hate you.
  #13  
Old April 6th 18, 06:22 AM posted to alt.windows7.general
Bob_S[_2_]
external usenet poster
 
Posts: 149
Default can't edit hosts file?

"Auric__" wrote in message
15.223...

Bob_S wrote:

Are you sure you have enabled hidden files and that you have the correct
HOSTS file (uppercase and no extension).


As a general rule, Windows isn't case-sensitive. It shouldn't matter if
it's
"hosts" or "HOSTS" or even something silly like "HoStS".


You are correct - it is not all uppercase. I made mine Uppercase to remind
me it has been modified to eliminate the bitcoin sites such as
coin-hive.com. I see my original hosts file has been renamed hosts.bak.

As you said, it's not case sensitive and I made it all caps a reminder for
me that obviously I'd forgotten about.

As for a guess as to why it is being locked - I'd be looking at any security
type software that may have a lock on it because they have modified the file
and blocking it from being modified.

Also just did a quick search and found this:
https://www.devside.net/wamp-server/...ows-hosts-file

--


Bob S.

  #14  
Old April 6th 18, 12:43 PM posted to alt.windows7.general
Mayayana
external usenet poster
 
Posts: 6,438
Default can't edit hosts file?

"J. P. Gilliver (John)" wrote

| Thanks, you and Ed. Excellent idea. Then I found my Process Explorer
| won't work! I've extracted it again from the .zip file I downloaded (and
| yes, it _did_ work then!); I run it, I get the UAC popup, I click Run in
| that, and - nothing happens. And there's nothing beginning with P in
| Task Manager other than Panorama.

Sounds fishy to me. Your software generally
works but editing HOSTS and running ProcExp
are blocked? I'd suspect some kind of sneaky
thing had got onto the system.

If it were me I'd first shut off UAC and if that
didn't clear things up I'd try downloading some
malware/AV products. (Many of them can be
downloaded as free packages for emergency use.)

The only other thing I can think of would be if you
had somehow screwed up file restrictions.... maybe
logging on as Guest or some such? But you have a
lot of experience. I can't think of anything you
might have done accidentally.
It's an interesting mystery.


  #15  
Old April 6th 18, 12:43 PM posted to alt.windows7.general
Ed Cryer
external usenet poster
 
Posts: 2,621
Default can't edit hosts file?

J. P. Gilliver (John) wrote:
In message 23,
Auric__ writes:
Char Jackson wrote:

On Thu, 5 Apr 2018 20:04:01 +0100, "J. P. Gilliver (John)"
wrote:

I'm sure I have edited it since moving to W7! But now when I try, I am
told it is in use: "The process cannot access the file because it is
being used by another process." (The process being plain original
NotePad.) If I try to delete it (having made a copy of course!), I get
"The action can't be completed because the file is open in System".

I've just done a restart, and tried again before opening anything I'd
have thought would be using it - no change. Though as I said, I'm sure
I've edited it before, and that _wouldn't_ have been under those
circumstances.

What's using it? "System" isn't very informative - could be a user
rather than a process.

Some AV programs will lock the hosts file to prevent malicious editing.
Also, I believe you have to run your editor, Notepad in this case, as
Administrator. If you're already aware of those restrictions, then I'm
not sure what the deal is.


If you have Sysinternals Process Explorer, search for "hosts" (Ctrl+F)
and
it'll show you what has it open. You can close the handle from the
lower main
pane (Ctrl+L). (You may need to "Show Details for All Processes".)

(Any program with similar capabilities should be able to do this.)

Otherwise, try rebooting to safe mode and editing there.

Thanks, you and Ed. Excellent idea. Then I found my Process Explorer
won't work! I've extracted it again from the .zip file I downloaded (and
yes, it _did_ work then!); I run it, I get the UAC popup, I click Run in
that, and - nothing happens. And there's nothing beginning with P in
Task Manager other than Panorama.


Try running it as Administrator.
If that doesn't work, look here;
https://support.microsoft.com/en-us/...does-not-start

If it's still unfixed after that, then do a comprehensive check of what
else is shut out; and then let us know.

Ed

 




Thread Tools
Display Modes 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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off






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


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 PCbanter.
The comments are property of their posters.