Sysop: | Amessyroom |
---|---|
Location: | Fayetteville, NC |
Users: | 23 |
Nodes: | 6 (0 / 6) |
Uptime: | 46:42:16 |
Calls: | 583 |
Files: | 1,138 |
Messages: | 111,067 |
On 12/07/2025 05:03, J. P. Gilliver wrote:
I have a shortcut to
, but it won't let me save when I've edited. I've tried "Take Ownership"
on C:\Windows\System32\drivers\etc, which seemed to run, but I still
can't save changes.
To edit and save the hosts file you need to launch Notepad as
Administrator. Then you need to visit the hosts file in Notepad by going to:
File >> Open <"C:\Windows\System32\drivers\etc\hosts">
Make sure "All Files" is selected in notepad.
To launch Notepad as Administrator you need to Right-Click on the
Notepad icon and choose rum as Administrator. The list is quite long so
pay particular attention to Run as Administrator.
The alternative method to edit and save the hosts file is to drag it to
the desktop, edit it and save it before dragging again to the correct
folder.
On 2025/7/12 6:8:4, Operation Sindoor wrote:
On 12/07/2025 05:03, J. P. Gilliver wrote:
I have a shortcut to
, but it won't let me save when I've edited. I've tried "Take Ownership" >>> on C:\Windows\System32\drivers\etc, which seemed to run, but I still
can't save changes.
(I don't know what happened above - maybe I forgot to paste in the
command line that's in my shortcut!)>
To edit and save the hosts file you need to launch Notepad asThanks - noted.>
Administrator. Then you need to visit the hosts file in Notepad by
going to:
File >> Open <"C:\Windows\System32\drivers\etc\hosts">
Make sure "All Files" is selected in notepad.
To launch Notepad as Administrator you need to Right-Click on the
Notepad icon and choose rum as Administrator. The list is quite long so
pay particular attention to Run as Administrator.
The alternative method to edit and save the hosts file is to drag it to
the desktop, edit it and save it before dragging again to the correct
folder.
The command line in my shortcut is
-a %windir%\system32\notepad.exe "C:\Windows\System32\drivers\etc\hosts."
I thought, maybe I can do what you suggest by making my _shortcut_ open
as administrator. So I ticked that box. Now, when I activate the
shortcut, it comes up with the do-you-want-to-allow...-to-make-changes prompt (which Notepad in normal mode doesn't usually), which sounded promising; I say yes, and notepad opens - but then pops up a box saying
it can't find hosts.txt, do I want to create it?
I've experimented with the above line - without quotes, with quotes but
no final ., and as above - all seem to open Notepad (with the do-you-want-to-allow, which is good), but thinking it's going to edit hosts.txt, rather than just hosts.
I suppose I could make a shortcut - with admin. open - to a two-line
batch file to edit notes.txt (or any other name, for that matter), and
then rename it to hosts (and also copy it to hosts.txt for next time;
or, copy hosts.txt to hosts), but I thought I'd ask here first if
there's any way to make the simple shortcut work.
Thought: does Notepad have some switch ... typing
-a-a-a-anotepad /?
into a command prompt. Notepad opened, with a popup "The filename,
directory name, or volume label syntax is incorrect." So I tried
-a-a-a-ahelp notepad
, and got
-a-a This command is not supported by the help utility.-a Try "notepad /?".
! Tried
-a-a-a-anotepad < "C:\Windows\System32\drivers\etc\hosts."
(both without and with the quote marks), and got "The system cannot find
the file specified." (I wondered if it just meant it couldn't find
notepad, but typing that by itself opens it.)
That batch file is sounding more and more likely, but I'll wait to see
if anyone here knows a way of, in a shortcut target line (or at the
command prompt), calling notepad with a parameter that has no extension!
(It works _with_ one, which doesn't have to be .txt; for example, I just tried
-a-a-a-a%windir%\system32\notepad.exe "C:\Windows\System32\drivers\etc\hosts.org"
[all one line, of course] and it opened notepad on that file.) I've
added the W11 and W7 'groups as this particular wrinkle - how to invoke notepad with an extensionless parameter - might generate knowledge
there, though the initial problem wasn't there in 7 (I can't remember
the details, but I had a shortcut to the hosts file that worked there).>
On 2025/7/12 6:8:4, Operation Sindoor wrote:
On 12/07/2025 05:03, J. P. Gilliver wrote:
I have a shortcut to
, but it won't let me save when I've edited. I've tried "Take Ownership" >> on C:\Windows\System32\drivers\etc, which seemed to run, but I still
can't save changes.
(I don't know what happened above - maybe I forgot to paste in the
command line that's in my shortcut!)>
To edit and save the hosts file you need to launch Notepad as Administrator. Then you need to visit the hosts file in Notepad by going to:
File >> Open <"C:\Windows\System32\drivers\etc\hosts">
Make sure "All Files" is selected in notepad.
To launch Notepad as Administrator you need to Right-Click on the
Notepad icon and choose rum as Administrator. The list is quite long so
pay particular attention to Run as Administrator.
The alternative method to edit and save the hosts file is to drag it to
the desktop, edit it and save it before dragging again to the correct folder.
Thanks - noted.>
The command line in my shortcut is
%windir%\system32\notepad.exe "C:\Windows\System32\drivers\etc\hosts."
I thought, maybe I can do what you suggest by making my _shortcut_ open
as administrator. So I ticked that box. Now, when I activate the
shortcut, it comes up with the do-you-want-to-allow...-to-make-changes prompt (which Notepad in normal mode doesn't usually), which sounded promising; I say yes, and notepad opens - but then pops up a box saying
it can't find hosts.txt, do I want to create it?
I've experimented with the above line - without quotes, with quotes but
no final ., and as above - all seem to open Notepad (with the do-you-want-to-allow, which is good), but thinking it's going to edit hosts.txt, rather than just hosts.
I suppose I could make a shortcut - with admin. open - to a two-line
batch file to edit notes.txt (or any other name, for that matter), and
then rename it to hosts (and also copy it to hosts.txt for next time;
or, copy hosts.txt to hosts), but I thought I'd ask here first if
there's any way to make the simple shortcut work.
Thought: does Notepad have some switch ... typing
notepad /?
into a command prompt. Notepad opened, with a popup "The filename,
directory name, or volume label syntax is incorrect." So I tried
help notepad
, and got
This command is not supported by the help utility. Try "notepad /?".
! Tried
notepad < "C:\Windows\System32\drivers\etc\hosts."
(both without and with the quote marks), and got "The system cannot find
the file specified." (I wondered if it just meant it couldn't find
notepad, but typing that by itself opens it.)
That batch file is sounding more and more likely, but I'll wait to see
if anyone here knows a way of, in a shortcut target line (or at the
command prompt), calling notepad with a parameter that has no extension!
(It works _with_ one, which doesn't have to be .txt; for example, I just tried
%windir%\system32\notepad.exe "C:\Windows\System32\drivers\etc\hosts.org"
[all one line, of course] and it opened notepad on that file.) I've
added the W11 and W7 'groups as this particular wrinkle - how to invoke notepad with an extensionless parameter - might generate knowledge
there, though the initial problem wasn't there in 7 (I can't remember
the details, but I had a shortcut to the hosts file that worked there).>
On 2025/7/12 6:8:4, Operation Sindoor wrote:
On 12/07/2025 05:03, J. P. Gilliver wrote:
I have a shortcut to
, but it won't let me save when I've edited. I've tried "Take Ownership" >>> on C:\Windows\System32\drivers\etc, which seemed to run, but I still
can't save changes.
(I don't know what happened above - maybe I forgot to paste in the
command line that's in my shortcut!)>
To edit and save the hosts file you need to launch Notepad asThanks - noted.>
Administrator. Then you need to visit the hosts file in Notepad by
going to:
File >> Open <"C:\Windows\System32\drivers\etc\hosts">
Make sure "All Files" is selected in notepad.
To launch Notepad as Administrator you need to Right-Click on the
Notepad icon and choose rum as Administrator. The list is quite long so
pay particular attention to Run as Administrator.
The alternative method to edit and save the hosts file is to drag it to
the desktop, edit it and save it before dragging again to the correct
folder.
The command line in my shortcut is
-a %windir%\system32\notepad.exe "C:\Windows\System32\drivers\etc\hosts."
I thought, maybe I can do what you suggest by making my _shortcut_ open
as administrator. So I ticked that box. Now, when I activate the
shortcut, it comes up with the do-you-want-to-allow...-to-make-changes prompt (which Notepad in normal mode doesn't usually), which sounded promising; I say yes, and notepad opens - but then pops up a box saying
it can't find hosts.txt, do I want to create it?
I've experimented with the above line - without quotes, with quotes but
no final ., and as above - all seem to open Notepad (with the do-you-want-to-allow, which is good), but thinking it's going to edit hosts.txt, rather than just hosts.
I suppose I could make a shortcut - with admin. open - to a two-line
batch file to edit notes.txt (or any other name, for that matter), and
then rename it to hosts (and also copy it to hosts.txt for next time;
or, copy hosts.txt to hosts), but I thought I'd ask here first if
there's any way to make the simple shortcut work.
Thought: does Notepad have some switch ... typing
-a-a-a-anotepad /?
into a command prompt. Notepad opened, with a popup "The filename,
directory name, or volume label syntax is incorrect." So I tried
-a-a-a-ahelp notepad
, and got
-a-a This command is not supported by the help utility.-a Try "notepad /?".
! Tried
-a-a-a-anotepad < "C:\Windows\System32\drivers\etc\hosts."
(both without and with the quote marks), and got "The system cannot find
the file specified." (I wondered if it just meant it couldn't find
notepad, but typing that by itself opens it.)
That batch file is sounding more and more likely, but I'll wait to see
if anyone here knows a way of, in a shortcut target line (or at the
command prompt), calling notepad with a parameter that has no extension!
(It works _with_ one, which doesn't have to be .txt; for example, I just tried
-a-a-a-a%windir%\system32\notepad.exe "C:\Windows\System32\drivers\etc\hosts.org"
[all one line, of course] and it opened notepad on that file.) I've
added the W11 and W7 'groups as this particular wrinkle - how to invoke notepad with an extensionless parameter - might generate knowledge
there, though the initial problem wasn't there in 7 (I can't remember
the details, but I had a shortcut to the hosts file that worked there).>
You need to do the simplest thing in Windows. From above I surmise that
you are doing the long winded method and it only complicates the matter.
In the search box type Notepad.exe. When you get the search result,
right click on it and choose run as administrator.
Then do what is shown in this picture:
<https://i.imgur.com/92EA7P9.png>
In the picture I have high-lighted All Files and file name I just copied
and pasted the link previously given.
hosts file hasn't got an extension and by default Notepad only sees .txt
file so you need to change this for this exercise.
All Windows System have hosts file (by default) unless the user or some malware has deleted it. It is easy to create one as it is a plain text
file. Make sure it is saved as "hosts" -- no .txt nor no ".". By dot I
mean don't save save as "hosts." <== Notice the dot in the file name.
Don't do it.
C:\WINDOWS\system32\write.exe c:\windows\system32\drivers\etc\hosts
works for me on XP
- I recommend you drop your trailing '.'Hmm. It will under 10 with mine, so far.
(notepad under XP won't open my large hosts file)
This shortcut works for me after setting it to open as administrator by ticking the box:
%windir%\system32\notepad.exe /A "C:\Windows\System32\drivers\etc\hosts"
Kerr-Mudd, John wrote:Well, these days so is notepad (Win11), you can bold/underline/italicise
C:\WINDOWS\system32\write.exe c:\windows\system32\drivers\etc\hosts
The above line works though. But, as it's trying to be a word processor
J. P. Gilliver wrote:
Kerr-Mudd, John wrote:Well, these days so is notepad (Win11), you can bold/underline/italicise text, and it gets saved in markdown format.-a Makes me worry how
C:\WINDOWS\system32\write.exe c:\windows\system32\drivers\etc\hosts
The above line works though. But, as it's trying to be a word processor
faithfully the file is saved with respect to CF/LF vs LF endings etc.
One wonders why they've done the change you describe; in effect, they've made what sounds like a WordPad clone. Do you still have WordPad?
Do they now look the same?
When you say it saves in "markdown" format, what
extension is that - .rtf?
I presume it still have a text-only _option_
(.txt), but I share your concern re newline formats.
Presumably one could copy a notepad.exe from a W10 or earlier. (The oneI think you can.
from 10 or 7 might have a bigger filesize limit than the one from XP.)
On 2025/7/12 22:1:13, Kerr-Mudd, John wrote:
[]
C:\WINDOWS\system32\write.exe c:\windows\system32\drivers\etc\hosts
Wow, I had no idea write.exe was still there! Though I seem to have
three copies. (All dated 2019-12-6.)
Though I remember that, from I think about Windows 95 or 98 on, it was there, but really just a redirect to Wordpad. And it _seems_ to be that here; hard to tell, as I can't do Help | About, since they've removed
Help from the menu of lots of things (maybe all integrated ones?) in 10.
On Sun, 13 Jul 2025 13:36:32 +0100
"J. P. Gilliver" <G6JPG@255soft.uk> wrote:
On 2025/7/12 22:1:13, Kerr-Mudd, John wrote:I think it's a synonym,i.e. "write" actually invokes, or is a copy
[]
C:\WINDOWS\system32\write.exe c:\windows\system32\drivers\etc\hosts
Wow, I had no idea write.exe was still there! Though I seem to have
three copies. (All dated 2019-12-6.)
Though I remember that, from I think about Windows 95 or 98 on, it was
there, but really just a redirect to Wordpad. And it _seems_ to be that
here; hard to tell, as I can't do Help | About, since they've removed
Help from the menu of lots of things (maybe all integrated ones?) in 10.
of wordpad - but 'write' is what I had in my shortcut from way back.
[]
On 2025/7/12 22:1:13, Kerr-Mudd, John wrote:
[]
C:\WINDOWS\system32\write.exe c:\windows\system32\drivers\etc\hosts
Wow, I had no idea write.exe was still there! Though I seem to have
three copies. (All dated 2019-12-6.)
In alt.comp.os.windows-11, on Sun, 13 Jul 2025 13:36:32 +0100, "J. P. Gilliver" <G6JPG@255soft.uk> wrote:
On 2025/7/12 22:1:13, Kerr-Mudd, John wrote:
[]
C:\WINDOWS\system32\write.exe c:\windows\system32\drivers\etc\hosts
Wow, I had no idea write.exe was still there! Though I seem to have
three copies. (All dated 2019-12-6.)
Hmmm. I don't have a copy in win11.
On 2025/7/12 22:7:28, MikeS wrote:
[]
This shortcut works for me after setting it to open as administrator
by ticking the box:
%windir%\system32\notepad.exe /A "C:\Windows\System32\drivers\etc\hosts"
Thanks - that works! I'd got to the same place - ticking the box in the shortcut with almost the above line in it - but it wasn't opening or
saving the extensionless file. (I could do it manually, but if a
shortcut can, why faff?) Your solution even saves without having to
select "all files" etcetera. (Well, I've left the . after hosts inside
the quotes in my version, as I had it there anyway.)
It's obviously the
-a-a-a-a/A
switch that made it work. How did you find out about that? (I wondered
if there _was_ some switch that would help, but both "/?" and "help
notepad" failed as I have described upthread, so I was a bit stuck
trying to find out.)
On 13/07/2025 13:43, J. P. Gilliver wrote:[]
On 2025/7/12 22:7:28, MikeS wrote:
[]
This shortcut works for me after setting it to open as administrator
by ticking the box:
%windir%\system32\notepad.exe /A "C:\Windows\System32\drivers\etc\hosts"
Thanks - that works! I'd got to the same place - ticking the box in
It's obviously the
-a-a-a-a-a/A
switch that made it work. How did you find out about that? (I wondered
if there _was_ some switch that would help, but both "/?" and "help
notepad" failed as I have described upthread, so I was a bit stuck
trying to find out.)
Google found this https://superuser.com/questions/1720078/windows-11-notepad-command-line- options
and it seems they still work.
I have five hits on W11 and five hits on W10, for "write.exe".
In alt.comp.os.windows-11, on Sun, 13 Jul 2025 13:36:32 +0100, "J. P. Gilliver" <G6JPG@255soft.uk> wrote:--- Synchronet 3.21a-Linux NewsLink 1.2
On 2025/7/12 22:1:13, Kerr-Mudd, John wrote:
[]
C:\WINDOWS\system32\write.exe c:\windows\system32\drivers\etc\hosts
Wow, I had no idea write.exe was still there! Though I seem to have
three copies. (All dated 2019-12-6.)
Hmmm. I don't have a copy in win11.
https://www.thewindowsclub.com/hosts-file-in-windows#:~:text=The%20Hosts%20file%20in%20Windows%2011%2F10%2C%20is%20used,file%20is%20used%20by%20Microsoft%20TCP%2FIP%20for%20Windows.
On 2025/7/15 21:47:14, MikeS wrote:
On 13/07/2025 13:43, J. P. Gilliver wrote:[]
On 2025/7/12 22:7:28, MikeS wrote:
[]
This shortcut works for me after setting it to open as administrator
by ticking the box:
%windir%\system32\notepad.exe /A
"C:\Windows\System32\drivers\etc\hosts"
Thanks - that works! I'd got to the same place - ticking the box in
Hmm. According to that, /A means "open file as ansi", which certainly doesn't sound like it ought to work to solve the problem I had. But itIt's obviously the
-a-a-a-a-a/A
switch that made it work. How did you find out about that? (I
wondered if there _was_ some switch that would help, but both "/?"
and "help notepad" failed as I have described upthread, so I was a
bit stuck trying to find out.)
Google found this
https://superuser.com/questions/1720078/windows-11-notepad-command-line- options
and it seems they still work.
does, so I'm haapy (though puzzled)!
This is a public service announcement related to editing the HOSTS file.
The "App Paths" key is perhaps the most magical key in all of registry.
What I've been doing, for decades, & which I posted on this newsgroup many times in the past, is I click on my "Runbox" icon in my taskbar and I type "hosts" where that action (which you'll never forget) edits the HOSTS file.
Win+R > hosts [carriagereturn]
This is a public service announcement related to editing the HOSTS file.
The "App Paths" key is perhaps the most magical key in all of registry.
What I've been doing, for decades, & which I posted on this newsgroup many >> times in the past, is I click on my "Runbox" icon in my taskbar and I type >> "hosts" where that action (which you'll never forget) edits the HOSTS file. >>
Win+R > hosts [carriagereturn]
"Windows cannot find 'hosts'. Make sure
you've typed the name correctly, then try again"
Might you have added the drivers/etc folder to a path, in the registry
or the environment?
On Wed, 16 Jul 2025 10:13:36 +0100, Andy Burns wrote :
This is a public service announcement related to editing the HOSTS file. >>> The "App Paths" key is perhaps the most magical key in all of registry.
What I've been doing, for decades, & which I posted on this newsgroup many >>> times in the past, is I click on my "Runbox" icon in my taskbar and I type >>> "hosts" where that action (which you'll never forget) edits the HOSTS file. >>>
Win+R > hosts [carriagereturn]
"Windows cannot find 'hosts'. Make sure
you've typed the name correctly, then try again"
Might you have added the drivers/etc folder to a path, in the registry
or the environment?
Hi Andy,
Good question. Nobody else noticed but you. That's 'cuz you tried it!
And that is a good thing because it means you will learn a lot below.
Very few people know Windows has multiple ways to find the paths.
I strive for everything I do on Windows to be a single step.
If it's two steps, then it's half as efficient as it should be.
That's why, long ago, I added the "hosts" command to the Windows runbox.
Win+R > hosts (this single step opens up the hosts file for editing)
I never accept two steps when a single step can be figured out.
And the magical thing about the way I did it is that it's a single step!
However... it didn't work for you (and I know why).
You tried the most magical of all Windows commands, but, unfortunately,
you skipped something, which almost nobody knows - so don't feel bad(ly).
First, thanks for trying the Windows magic which I consider the finest efficiency tool that any operating system ever made (other than an alias).
I completely understand what happened to you when you tried it.
In fact, it's *supposed* to happen exactly like it did for you.
So you didn't do anything wrong.
The magic is that there are TWO ways to find the path to any command:
a. The Windows "PATH" system variable (and all its variants)
b. The Windows "App Paths" key (which is inside the registry)
In fact, what I do BEFORE I set up any magical commands is do what you did. If Win+R > hosts actually does something, then I pick a different keyword.
Since you've helped people on the newsgroup a lot, let me show you.
Let's take the example of the "regopen" command to illustrate.
Step 1.
Enter "regopen" into the Windows Win+R runbox. What happens?
Windows cannot find "regopen"! Right? Good. You want that to happen.
That tells you it's an available (i.e., unused) keyword, "regopen".
Step 2.
Enter a "regopen.exe" registry subkey in the App Paths registry key.
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\regopen.exe
@Default=C:\path\link\regopen.lnk
Note: There is no executable called "regopen.exe"; it's just a name.
For the Windows magic to work, the keyword must end with "exe".
Step 3: (This is only necessary because we want to avoid the UAC prompt!)
Create a link with the TARGET being a call to Windows Task Manager.
TARGET=C:\Windows\System32\schtasks.exe /run /TN "Task Regopen"
Step 4:
Create that task in the Windows task manager (Win+R > taskschd.msc).
Name=Task Regopen (start all your custom tasks with the same keyword!)
[x]Run with highest privileges (as the whole point is to avoid the UAC!)
Start a program = C:\Windows\regedit.exe
Voila!
Now, when you click your pinned Runbox & type "regopen", up pops the
registry ready to edit without you having to perform any other clicks.
If it takes two steps to open the registry, you're doing it inefficiently.
NOTE: If you didn't want to avoid the UAC prompt, you could skip 3 of the 4 steps above because you can open a file using just step 1 above, and you
can open up a directory using only steps 1 and 2 above.
The only reason the setup is four steps instead of just one step, is
because we have to do extra stuff to avoid the UAC prompt asking for OK.
for Win 11 just enter "hosts" into taskbar search box and you will eventually get to "C:\Windows\System32\drivers\etc\hosts" which is
actually a txt file.
On 15/07/2025 22:58, J. P. Gilliver wrote:
On 2025/7/15 21:47:14, MikeS wrote:
On 13/07/2025 13:43, J. P. Gilliver wrote:[]
On 2025/7/12 22:7:28, MikeS wrote:
[]
This shortcut works for me after setting it to open as
administrator by ticking the box:
%windir%\system32\notepad.exe /A "C:
\Windows\System32\drivers\etc\hosts"
Thanks - that works! I'd got to the same place - ticking the box in
Hmm. According to that, /A means "open file as ansi", which certainlyIt's obviously the
-a-a-a-a-a/A
switch that made it work. How did you find out about that? (I
wondered if there _was_ some switch that would help, but both "/?"
and "help notepad" failed as I have described upthread, so I was a
bit stuck trying to find out.)
Google found this
https://superuser.com/questions/1720078/windows-11-notepad-command-
line- options
and it seems they still work.
doesn't sound like it ought to work to solve the problem I had. But it
does, so I'm haapy (though puzzled)!
The same shortcut works without /A so I'm puzzled as to why you had a problem!
Zaidy036 wrote:
for Win 11 just enter "hosts" into taskbar search box and you will
eventually get to "C:\Windows\System32\drivers\etc\hosts" which is
actually a txt file.
Yesbut ... you can't just edit it unless you're an admin, or you edit it
as admin ...
I don't understand why the various shortcuts mentioned early in the
thread wouldn't work.
Back to Andy's dilemma, I do not understand what is not working for Andy.