• How do I get at the hosts file?

    From J. P. Gilliver@21:1/5 to All on Sat Jul 12 05:03:49 2025
    I have a shortcut to

    %windir%\system32\notepad.exe C:\Windows\System32\drivers\etc\hosts

    , 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.
    --
    J. P. Gilliver. UMRA: 1960/<1985 MB++G()AL-IS-Ch++(p)Ar@T+H+Sh0!:`)DNAf

    He's incorrigibly naughty, as only a senior citizen can be.
    - David Hepworth (on Barry Humphries), RT 2020/2/1-7

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Operation Sindoor@21:1/5 to J. P. Gilliver on Sat Jul 12 05:08:04 2025
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From J. P. Gilliver@21:1/5 to Operation Sindoor on Sat Jul 12 14:37:20 2025
    XPost: alt.comp.os.windows-11, alt.windows7.general

    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).>







    --
    J. P. Gilliver. UMRA: 1960/<1985 MB++G()AL-IS-Ch++(p)Ar@T+H+Sh0!:`)DNAf

    "Victory does not bring with it a sense of triumph - rather the dull
    numbness of relief..."
    - Cecil Beaton quoted by Anthony Horowitz, RT 2015/1/3-9

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Operation Sindoor@21:1/5 to J. P. Gilliver on Sat Jul 12 19:39:53 2025
    XPost: alt.comp.os.windows-11, alt.windows7.general

    On 12/07/2025 14:37, J. P. Gilliver wrote:
    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).>









    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.

    Hope this helps.

    Jai Hind

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dillinger@21:1/5 to J. P. Gilliver on Sat Jul 12 22:06:56 2025
    On Sat, 12 Jul 2025 05:03:49 +0100, J. P. Gilliver wrote:

    I have a shortcut to

    %windir%\system32\notepad.exe C:\Windows\System32\drivers\etc\hosts

    , 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.

    Don't play with notepad, install Microsoft Powertoys, it has a nice noob friendly hosts file editor: https://learn.microsoft.com/en-us/windows/powertoys/hosts-file-editor

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From MikeS@21:1/5 to J. P. Gilliver on Sat Jul 12 22:07:28 2025
    XPost: alt.comp.os.windows-11, alt.windows7.general

    On 12/07/2025 14:37, J. P. Gilliver wrote:
    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).>







    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"

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kerr-Mudd, John@21:1/5 to J. P. Gilliver on Sat Jul 12 22:01:13 2025
    XPost: alt.comp.os.windows-11, alt.windows7.general

    On Sat, 12 Jul 2025 14:37:20 +0100
    "J. P. Gilliver" <[email protected]> wrote:

    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).>




    C:\WINDOWS\system32\write.exe c:\windows\system32\drivers\etc\hosts

    works for me on XP
    - as does
    %windir%\system32\write.exe c:\windows\system32\drivers\etc\hosts
    and
    %windir%\system32\write.exe %windir%\system32\drivers\etc\hosts



    - I recommend you drop your trailing '.'

    (notepad under XP won't open my large hosts file)
    --
    Bah, and indeed Humbug.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From s|b@21:1/5 to Operation Sindoor on Sun Jul 13 14:07:48 2025
    On Sat, 12 Jul 2025 05:08:04 +0000, Operation Sindoor wrote:

    To edit and save the hosts file you need to launch Notepad as
    Administrator.

    I think opening Explorer as administrator, go to HOSTS and then use
    Notepad will work as well. (?)

    --
    s|b

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From J. P. Gilliver@21:1/5 to All on Sun Jul 13 13:22:52 2025
    XPost: alt.comp.os.windows-11, alt.windows7.general

    T24gMjAyNS83LzEyIDIwOjM5OjUzLCBPcGVyYXRpb24gU2luZG9vciB3cm90ZToNCltdDQoN Cj4gWW91IG5lZWQgdG8gZG8gdGhlIHNpbXBsZXN0IHRoaW5nIGluIFdpbmRvd3MuIEZyb20g YWJvdmUgSSBzdXJtaXNlIHRoYXQNCj4geW91IGFyZSBkb2luZyB0aGUgbG9uZyB3aW5kZWQg bWV0aG9kIGFuZCBpdCBvbmx5IGNvbXBsaWNhdGVzIHRoZSBtYXR0ZXIuDQo+IA0KPiBJbiB0 aGUgc2VhcmNoIGJveCB0eXBlIE5vdGVwYWQuZXhlLiBXaGVuIHlvdSBnZXQgdGhlIHNlYXJj aCByZXN1bHQsDQo+IHJpZ2h0IGNsaWNrIG9uIGl0IGFuZCBjaG9vc2UgcnVuIGFzIGFkbWlu aXN0cmF0b3IuDQo+IA0KPiBUaGVuIGRvIHdoYXQgaXMgc2hvd24gaW4gdGhpcyBwaWN0dXJl Og0KPiANCj4gPGh0dHBzOi8vaS5pbWd1ci5jb20vOTJFQTdQOS5wbmc+DQo+IA0KPiBJbiB0 aGUgcGljdHVyZSBJIGhhdmUgaGlnaC1saWdodGVkIEFsbCBGaWxlcyBhbmQgZmlsZSBuYW1l IEkganVzdCBjb3BpZWQNCj4gYW5kIHBhc3RlZCB0aGUgbGluayBwcmV2aW91c2x5IGdpdmVu Lg0KDQpTbyB5b3VyICAic2ltcGxlc3QgdGhpbmciIGlzOg0KMS4gc2VhcmNoIGZvciBOb3Rl cGFkDQoyLiBvcGVuIGl0IGFzIGFkbWluaXN0cmF0b3INCjMuIHdvcmsgbXkgd2F5IHRvIHdo ZXJlIGhvc3RzIGlzIChzZXZlcmFsIHN0ZXBzIHJlYWxseSkNCjQuIGVkaXQgaXQNCjUuIHNh dmUgaXQsIGNoYW5naW5nIHRvICJhbGwgZmlsZXMiIChtb3JlIHRoYW4gb25lIHN0ZXAgcmVh bGx5KQ0KDQotIE9LLCBub3RoaW5nIGNvbXBsaWNhdGVkLCBidXQgbm90IElNTyAic2ltcGxl IiENCg0KSSdtIGFmdGVyIHNpbmdsZS1jbGljayAtIGFuZCwgd2l0aCBNaWtlUydzIGhlbHAs IGhhdmUgYWNoaWV2ZWQgaXQhIChTZWUgDQpsYXRlciBwb3N0Lik+DQo+IGhvc3RzIGZpbGUg aGFzbid0IGdvdCBhbiBleHRlbnNpb24gYW5kIGJ5IGRlZmF1bHQgTm90ZXBhZCBvbmx5IHNl ZXMgLnR4dA0KPiBmaWxlIHNvIHlvdSBuZWVkIHRvIGNoYW5nZSB0aGlzIGZvciB0aGlzIGV4 ZXJjaXNlLg0KPiANCj4gQWxsIFdpbmRvd3MgU3lzdGVtIGhhdmUgaG9zdHMgZmlsZSAoYnkg ZGVmYXVsdCkgdW5sZXNzIHRoZSB1c2VyIG9yIHNvbWUNCj4gbWFsd2FyZSBoYXMgZGVsZXRl ZCBpdC4gSXQgaXMgZWFzeSB0byBjcmVhdGUgb25lIGFzIGl0IGlzIGEgcGxhaW4gdGV4dA0K PiBmaWxlLiBNYWtlIHN1cmUgaXQgaXMgc2F2ZWQgYXMgImhvc3RzIiAtLSBubyAudHh0IG5v ciBubyAiLiIuIEJ5IGRvdCBJDQo+IG1lYW4gZG9uJ3Qgc2F2ZSBzYXZlIGFzICJob3N0cy4i ICA8PT0gTm90aWNlIHRoZSBkb3QgaW4gdGhlIGZpbGUgbmFtZS4NCj4gRG9uJ3QgZG8gaXQu DQoNCihZZXMsIEkga25ldyB0aGF0LCB0aGFua3MuKQ0KW10NCi0tIA0KSi4gUC4gR2lsbGl2 ZXIuIFVNUkE6IDE5NjAvPDE5ODUgTUIrK0coKUFMLUlTLUNoKysocClBckBUK0grU2gwITpg KUROQWYNCgANCiJCb3RoZXIsInNhaWRQb29od2hlbmhpc3NwYWNlYmFycmVmdXNlZHRvd29y ay4NCg==

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From J. P. Gilliver@21:1/5 to John on Sun Jul 13 13:36:32 2025
    XPost: alt.comp.os.windows-11, alt.windows7.general

    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.

    The above line works though. But, as it's trying to be a word processor,
    it has broken the lines over a certain length. I thought maybe that
    won't matter if I "save as" a plain text file, so I tried (I have a
    backup). It _has_ no "all files" option (it defaults to .txt extension),
    but it accepted me putting it in quotes ("hosts.") - it said it existed,
    did I want to overwrite?; but when I said yes, it said it didn't have permission, or similar. It probably would have worked if I'd done it as administrator, but in that case I might as well use Notepad.>
    works for me on XP

    Editing hosts. wasn't much of a problem for me under 7, either; however,
    under 10, it's been made more difficult. However, with MikeS's help (see another post), I'm there.
    []

    - I recommend you drop your trailing '.'

    (notepad under XP won't open my large hosts file)
    Hmm. It will under 10 with mine, so far.
    --
    J. P. Gilliver. UMRA: 1960/<1985 MB++G()AL-IS-Ch++(p)Ar@T+H+Sh0!:`)DNAf

    "Bother,"saidPoohwhenhisspacebarrefusedtowork.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andy Burns@21:1/5 to J. P. Gilliver on Sun Jul 13 13:44:14 2025
    XPost: alt.comp.os.windows-11, alt.windows7.general

    J. P. Gilliver wrote:

    Kerr-Mudd, John wrote:

    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
    Well, these days so is notepad (Win11), you can bold/underline/italicise
    text, and it gets saved in markdown format. Makes me worry how
    faithfully the file is saved with respect to CF/LF vs LF endings etc.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From J. P. Gilliver@21:1/5 to All on Sun Jul 13 13:43:56 2025
    XPost: alt.comp.os.windows-11, alt.windows7.general

    T24gMjAyNS83LzEyIDIyOjc6MjgsIE1pa2VTIHdyb3RlOg0KW10NCg0KPiBUaGlzIHNob3J0 Y3V0IHdvcmtzIGZvciBtZSBhZnRlciBzZXR0aW5nIGl0IHRvIG9wZW4gYXMgYWRtaW5pc3Ry YXRvciBieSANCj4gdGlja2luZyB0aGUgYm94Og0KPiAld2luZGlyJVxzeXN0ZW0zMlxub3Rl cGFkLmV4ZSAvQSAiQzpcV2luZG93c1xTeXN0ZW0zMlxkcml2ZXJzXGV0Y1xob3N0cyINCg0K VGhhbmtzIC0gdGhhdCB3b3JrcyEgSSdkIGdvdCB0byB0aGUgc2FtZSBwbGFjZSAtIHRpY2tp bmcgdGhlIGJveCBpbiB0aGUgDQpzaG9ydGN1dCB3aXRoIGFsbW9zdCB0aGUgYWJvdmUgbGlu ZSBpbiBpdCAtIGJ1dCBpdCB3YXNuJ3Qgb3BlbmluZyBvciANCnNhdmluZyB0aGUgZXh0ZW5z aW9ubGVzcyBmaWxlLiAoSSBjb3VsZCBkbyBpdCBtYW51YWxseSwgYnV0IGlmIGEgDQpzaG9y dGN1dCBjYW4sIHdoeSBmYWZmPykgWW91ciBzb2x1dGlvbiBldmVuIHNhdmVzIHdpdGhvdXQg aGF2aW5nIHRvIA0Kc2VsZWN0ICJhbGwgZmlsZXMiIGV0Y2V0ZXJhLiAoV2VsbCwgSSd2ZSBs ZWZ0IHRoZSAuIGFmdGVyIGhvc3RzIGluc2lkZSANCnRoZSBxdW90ZXMgaW4gbXkgdmVyc2lv biwgYXMgSSBoYWQgaXQgdGhlcmUgYW55d2F5LikNCg0KSXQncyBvYnZpb3VzbHkgdGhlDQoN CgkvQQ0KDQpzd2l0Y2ggdGhhdCBtYWRlIGl0IHdvcmsuIEhvdyBkaWQgeW91IGZpbmQgb3V0 IGFib3V0IHRoYXQ/IChJIHdvbmRlcmVkIA0KaWYgdGhlcmUgX3dhc18gc29tZSBzd2l0Y2gg dGhhdCB3b3VsZCBoZWxwLCBidXQgYm90aCAiLz8iIGFuZCAiaGVscCANCm5vdGVwYWQiIGZh aWxlZCBhcyBJIGhhdmUgZGVzY3JpYmVkIHVwdGhyZWFkLCBzbyBJIHdhcyBhIGJpdCBzdHVj ayANCnRyeWluZyB0byBmaW5kIG91dC4pDQotLSANCkouIFAuIEdpbGxpdmVyLiBVTVJBOiAx OTYwLzwxOTg1IE1CKytHKClBTC1JUy1DaCsrKHApQXJAVCtIK1NoMCE6YClETkFmDQoADQoi Qm90aGVyLCJzYWlkUG9vaHdoZW5oaXNzcGFjZWJhcnJlZnVzZWR0b3dvcmsuDQo=

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From J. P. Gilliver@21:1/5 to All on Sun Jul 13 13:46:18 2025
    On 2025/7/13 13:7:48, s|b wrote:
    On Sat, 12 Jul 2025 05:08:04 +0000, Operation Sindoor wrote:

    To edit and save the hosts file you need to launch Notepad as
    Administrator.

    I think opening Explorer as administrator, go to HOSTS and then use
    Notepad will work as well. (?)


    Yes, it probably would. But I've managed to create an admin-enabled
    shortcut that does it - see my reply to MikeS; it seems it's the "/A"
    switch that solves the problem!
    --
    J. P. Gilliver. UMRA: 1960/<1985 MB++G()AL-IS-Ch++(p)Ar@T+H+Sh0!:`)DNAf

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From s|b@21:1/5 to J. P. Gilliver on Sun Jul 13 14:55:26 2025
    On Sun, 13 Jul 2025 13:46:18 +0100, J. P. Gilliver wrote:

    Yes, it probably would. But I've managed to create an admin-enabled
    shortcut that does it - see my reply to MikeS; it seems it's the "/A"
    switch that solves the problem!

    I'm guessing you want to use the HOSTS file to block ads (and/or
    malware)? Maybe look into Pi-Hole. It can be installed on a Raspberry Pi
    Zero 2 W (or even an older model), so pretty cheap to filter ads and
    malware in your whole network.

    --
    s|b

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From J. P. Gilliver@21:1/5 to dillinger on Sun Jul 13 14:01:08 2025
    On 2025/7/12 21:6:56, dillinger wrote:
    On Sat, 12 Jul 2025 05:03:49 +0100, J. P. Gilliver wrote:

    I have a shortcut to

    %windir%\system32\notepad.exe C:\Windows\System32\drivers\etc\hosts

    , 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.

    Don't play with notepad, install Microsoft Powertoys, it has a nice noob

    Oh, the above worked fine once the /A switch had been added - see my
    reply to MikeS.

    friendly hosts file editor: https://learn.microsoft.com/en-us/windows/powertoys/hosts-file-editor

    I had a look at that out of curiosity. Interesting that it describes the
    hosts file under its original purpose, i. e. doing redirects (e. g.
    while moving a website is filtering through the DNS world), but doesn't
    mention the purpose we all use it for!

    Yes, the "noob" editor function does, well, make editing hosts easy for
    noobs (and anyone else, I suppose). But when using it for what we mostly
    do, I think it's probably overkill - Notepad works well enough: the
    format of the hosts file isn't particularly complicated, after all.

    Interesting that it says it makes backups in etc., called hosts_PowerToysBackup_YYYYMMDDHHMMSS, _and they are deleted after 15
    days_; I wonder if that (the deletions) is a system function. Probably a PowerToys one.


    I presume, in the not too distant future - I'm surprised it hasn't
    happened already - due to pressure from industry (especially the
    advertising industry), there will be a version of Windows - or, worse,
    an update to 10 and/or 11 - where what we mostly use the hosts file for
    is disabled. )-:
    --
    J. P. Gilliver. UMRA: 1960/<1985 MB++G()AL-IS-Ch++(p)Ar@T+H+Sh0!:`)DNAf

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From J. P. Gilliver@21:1/5 to Andy Burns on Sun Jul 13 14:22:55 2025
    XPost: alt.comp.os.windows-11, alt.windows7.general

    On 2025/7/13 13:44:14, Andy Burns wrote:
    J. P. Gilliver wrote:

    Kerr-Mudd, John wrote:

    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
    Well, these days so is notepad (Win11), you can bold/underline/italicise text, and it gets saved in markdown format.  Makes me worry how
    faithfully the file is saved with respect to CF/LF vs LF endings etc.

    Ah, that's obviously a difference between 10 and 11. In 10's notepad,
    there's no row of formatting buttons; there's a function to change font,
    but I think that's only what font you see while editing. (I tried
    changing to a bold font, but although I had a line highlighted, it
    changed the whole file I could see, not just that line.) And the only
    options under Save As are Text File (.txt) and All files (*.*), with I
    presume the latter still saving a text file, but allowing you to use a different (or no) extension.

    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 one
    from 10 or 7 might have a bigger filesize limit than the one from XP.)
    --
    J. P. Gilliver. UMRA: 1960/<1985 MB++G()AL-IS-Ch++(p)Ar@T+H+Sh0!:`)DNAf

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From J. P. Gilliver@21:1/5 to All on Sun Jul 13 14:29:03 2025
    On 2025/7/13 13:55:26, s|b wrote:
    On Sun, 13 Jul 2025 13:46:18 +0100, J. P. Gilliver wrote:

    Yes, it probably would. But I've managed to create an admin-enabled
    shortcut that does it - see my reply to MikeS; it seems it's the "/A"
    switch that solves the problem!

    I'm guessing you want to use the HOSTS file to block ads (and/or

    Of course (-:

    malware)? Maybe look into Pi-Hole. It can be installed on a Raspberry Pi

    I guess I'd use it to block malware too, but that would require knowing
    what to block! (As does blocking ad.s too of course, but those are not
    too hard to find.) I suppose some scripts come close to being malware.

    Zero 2 W (or even an older model), so pretty cheap to filter ads and
    malware in your whole network.

    Ah, my "whole network" is only this laptop! (With an old industrial
    colour laser printer connected by USB, and the odd external drive
    [spinning or USB].)
    --
    J. P. Gilliver. UMRA: 1960/<1985 MB++G()AL-IS-Ch++(p)Ar@T+H+Sh0!:`)DNAf

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andy Burns@21:1/5 to J. P. Gilliver on Sun Jul 13 15:29:06 2025
    XPost: alt.comp.os.windows-11, alt.windows7.general

    J. P. Gilliver wrote:

    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?

    No, wordpad is gone in latest win11, you can get it back by copying the
    .exe and a couple of .dlls

    Do they now look the same?

    I still looks mostly like notepad (do you get the multi-tab version on
    win10?) bu with a format bar tacked onto the end of the menu bar.

    When you say it saves in "markdown" format, what
    extension is that - .rtf?

    .md files, as used in wikis

    <https://en.wikipedia.org/wiki/Markdown#Examples>

    I presume it still have a text-only _option_
    (.txt), but I share your concern re newline formats.

    yes, if you've used formatting it defaults to .md but offers .txt as an
    option, with a warning you'll lose the formatting.

    Presumably one could copy a notepad.exe from a W10 or earlier. (The one
    from 10 or 7 might have a bigger filesize limit than the one from XP.)
    I think you can.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From s|b@21:1/5 to J. P. Gilliver on Sun Jul 13 17:47:47 2025
    On Sun, 13 Jul 2025 14:29:03 +0100, J. P. Gilliver wrote:

    malware)? Maybe look into Pi-Hole. It can be installed on a Raspberry Pi

    I guess I'd use it to block malware too, but that would require knowing
    what to block! (As does blocking ad.s too of course, but those are not
    too hard to find.) I suppose some scripts come close to being malware.

    There's blacklists you can add and they're updated automatically.
    Default list is Steve Black: <<https://github.com/StevenBlack/hosts>

    And then there's hagezi:
    <https://github.com/hagezi/dns-blocklists>

    and others.

    Pi-Hole 6 now also works with whitelists.

    Ah, my "whole network" is only this laptop! (With an old industrial
    colour laser printer connected by USB, and the odd external drive
    [spinning or USB].)

    I've got 2 PCs and a laptop, but there are smartphones, smart plugs,
    smart tv, printer, A/V receiver, DVD Player, ...

    --
    s|b

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From knuttle@21:1/5 to Andy Burns on Sun Jul 13 17:34:25 2025
    XPost: alt.comp.os.windows-11, alt.windows7.general

    On 07/13/2025 10:29 AM, Andy Burns wrote:
    J. P. Gilliver wrote:

    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?

    No, wordpad is gone in latest win11, you can get it back by copying
    the .exe and a couple of .dlls

    Do they now look the same?

    I still looks mostly like notepad (do you get the multi-tab version on win10?) bu with a format bar tacked onto the end of the menu bar.

    When you say it saves in "markdown" format, what extension is that
    - .rtf?

    .md files, as used in wikis

    <https://en.wikipedia.org/wiki/Markdown#Examples>

    I presume it still have a text-only _option_ (.txt), but I share your
    concern re newline formats.

    yes, if you've used formatting it defaults to .md but offers .txt as an option, with a warning you'll lose the formatting.

    Presumably one could copy a notepad.exe from a W10 or earlier. (The
    one from 10 or 7 might have a bigger filesize limit than the one from
    XP.)
    I think you can.
    I had been using MS Word suite on one computer, and became quite
    frustrated as nothing was obvious, especially those thing you do not use
    every day. This is a strategic computer, so has to be functional on
    demand.

    It had to be replaced recently. I got all of the software transferred
    and then tried to transfer MS word Permanent to the new computer. After
    playing password tag, I got frustrated and tried to use the company's subscription MS Word. Significantly more tag, and I needed the computer
    the following Monday.

    In desperation, I downloaded Libreoffice, as it was suppose to open MS
    Word, Excel, etc files. The learning curve is minimal as all function
    grouped to their function and can be found easily, without jumping
    through hoops.

    Bottom line, even though I finally got the Permanent MS Word transferred
    to the new computer; I am continuing to use Libreoffice. It has much
    simpler interfaces and the easy to find seldom used functions that when
    you need them you really need them. No Search, and then not being able
    to find in in the confusing ribbon menu, so you have to search each time
    you need it.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kerr-Mudd, John@21:1/5 to J. P. Gilliver on Mon Jul 14 20:10:04 2025
    XPost: alt.comp.os.windows-11, alt.windows7.general

    On Sun, 13 Jul 2025 13:36:32 +0100
    "J. P. Gilliver" <[email protected]> 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.)

    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.

    I think it's a synonym,i.e. "write" actually invokes, or is a copy
    of wordpad - but 'write' is what I had in my shortcut from way back.
    []



    --
    Bah, and indeed Humbug.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From J. P. Gilliver@21:1/5 to John on Mon Jul 14 22:02:35 2025
    XPost: alt.comp.os.windows-11, alt.windows7.general

    On 2025/7/14 20:10:4, Kerr-Mudd, John wrote:
    On Sun, 13 Jul 2025 13:36:32 +0100
    "J. P. Gilliver" <[email protected]> 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.)

    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.

    I think it's a synonym,i.e. "write" actually invokes, or is a copy
    of wordpad - but 'write' is what I had in my shortcut from way back.
    []

    Interesting! I remember in wherever WordPad first appeared - Windows 9x
    I think - that write.exe was there (though not called from any shortcut
    in the start menu), but, indeed, invoked WordPad. I can't remember if it
    was a copy of Wordpad, or just some sort of redirect; I think the latter.>
    On this Windows 10 (64 bit), I have wordpad.exe (all details from
    everything):
    2,736 KB, 2019/12/6, in C:\Program Files (x86)\Windows NT\Accessories
    2,904 KB, 2025/7/10 (!), in C:\Program Files\Windows NT\Accessories
    plus various sizes from 36 KB to 2,904 KB in ...\WinSXS\... .

    and write.exe:
    10 KB, 2019/12/6 19:46, in C:\Windows\SysWOW64 and ...\WinSXS\...
    11 KB, 2019/12/6 21:29, in C:\Windows (!), C:\Windows\System32, and ...\WinSXS\... .>
    If I run any of them ones not in WinSXS, what opens loos the same - and,
    even if I ran a write.exe, the title bar says "Document - WordPad", so
    looks like they're a redirect (10 or 11 KB is nowhere near enough to be
    a word processor, at least not if you're Microsoft). I can't check
    versions from running as W10 has removed Help | About from the menu bar
    (well, Help altogether).
    --
    J. P. Gilliver. UMRA: 1960/<1985 MB++G()AL-IS-Ch++(p)Ar@T+H+Sh0!:`)DNAf

    Back then, many radio sets were still in black and white.
    - Eddie Mair, radio presenter, on "PM" programme reaching 40; in Radio
    Times, 3-9 April 2010

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From micky@21:1/5 to Gilliver" on Tue Jul 15 14:32:58 2025
    XPost: alt.comp.os.windows-11, alt.windows7.general

    In alt.comp.os.windows-11, on Sun, 13 Jul 2025 13:36:32 +0100, "J. P.
    Gilliver" <[email protected]> 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.


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul@21:1/5 to micky on Tue Jul 15 14:37:10 2025
    XPost: alt.comp.os.windows-11, alt.windows7.general

    On Tue, 7/15/2025 2:32 PM, micky wrote:
    In alt.comp.os.windows-11, on Sun, 13 Jul 2025 13:36:32 +0100, "J. P. Gilliver" <[email protected]> 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.


    I have five hits on W11 and five hits on W10, for "write.exe".

    Paul

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marion@21:1/5 to Paul on Tue Jul 15 19:09:44 2025
    XPost: alt.comp.os.windows-11, alt.windows7.general

    On Tue, 15 Jul 2025 14:37:10 -0400, Paul wrote :


    I have five hits on W11 and five hits on W10, for "write.exe".

    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]

    I forgot how I managed that, since I have hundreds of similar commands on Windows to do what I want simply by typing what I want (e.g., printers).

    There's nothing more magical on WIndows than that App Paths registry key. Everything you ever needed to do, is a simple one-word-command action!

    But how did I do it?
    I don't recall.

    Working backward, I see that "hosts" points to a "hosts.exe" subkey.
    HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\hosts.exe

    That "hosts.exe" subkey points to a value which happens to be a shortcut.
    @Default=C:\link\hosts.lnk

    Further reversing the stitching, the " of that shortcut are:
    TARGET=C:\Windows\System32\schtasks.exe /run /TN "Task hosts edit"

    Pulling more thread out, a Win+R > taskschd.msc brings up "Task hosts edit"
    ACTIONS=C:\programs\editors\text\vim\vim.exe C:\windows\system32\drivers\etc\hosts
    [x]Run with highest privileges

    Note: This edits the hosts file in GVim without those annoying UAC prompts. Please try it and let the team know how well it works out for you.

    I think this key is the most valuable key for efficiencey in all Windows.
    --
    Note that hosts.exe is not a file. It's just a subkey. It can be any name.
    But in the App Paths key, the subkeys have to end with "exe" to work magic.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From MikeS@21:1/5 to J. P. Gilliver on Tue Jul 15 21:47:14 2025
    XPost: alt.comp.os.windows-11, alt.windows7.general

    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 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

    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From J. P. Gilliver@21:1/5 to MikeS on Tue Jul 15 22:58:06 2025
    XPost: alt.comp.os.windows-11, alt.windows7.general

    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
    []

    It's obviously the

         /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.

    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 it
    does, so I'm haapy (though puzzled)!
    --
    J. P. Gilliver. UMRA: 1960/<1985 MB++G()AL-IS-Ch++(p)Ar@T+H+Sh0!:`)DNAf

    Reality television. It's eroding the ability of good scripted television
    to survive. - Patrick Duffy in Radio Times 2-8 February 2013

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Zaidy036@21:1/5 to micky on Tue Jul 15 22:02:46 2025
    XPost: alt.comp.os.windows-11, alt.windows7.general

    On 7/15/2025 2:32 PM, micky wrote:
    In alt.comp.os.windows-11, on Sun, 13 Jul 2025 13:36:32 +0100, "J. P. Gilliver" <[email protected]> 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.
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From MikeS@21:1/5 to J. P. Gilliver on Wed Jul 16 08:21:29 2025
    XPost: alt.comp.os.windows-11, alt.windows7.general

    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
    []

    It's obviously the

         /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.

    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 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!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andy Burns@21:1/5 to Marion on Wed Jul 16 10:13:36 2025
    XPost: alt.comp.os.windows-11, alt.windows7.general

    Marion 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?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marion@21:1/5 to Andy Burns on Wed Jul 16 20:06:36 2025
    XPost: alt.comp.os.windows-11, alt.windows7.general

    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Zaidy036@21:1/5 to Marion on Wed Jul 16 16:36:32 2025
    XPost: alt.comp.os.windows-11, alt.windows7.general

    On 7/16/2025 4:06 PM, Marion wrote:
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andy Burns@21:1/5 to All on Wed Jul 16 22:14:28 2025
    XPost: alt.comp.os.windows-11, alt.windows7.general

    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From J. P. Gilliver@21:1/5 to MikeS on Thu Jul 17 01:33:48 2025
    XPost: alt.comp.os.windows-11, alt.windows7.general

    On 2025/7/16 8:21:29, MikeS wrote:
    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
    []

    It's obviously the

         /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.

    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 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!

    Yes, I've just tried removing it from my shortcut, and it still works
    for me too now!
    --
    J. P. Gilliver. UMRA: 1960/<1985 MB++G()AL-IS-Ch++(p)Ar@T+H+Sh0!:`)DNAf

    It costs a lot to look this cheap - Dolly Parton

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marion@21:1/5 to Andy Burns on Thu Jul 17 01:52:23 2025
    XPost: alt.comp.os.windows-11, alt.windows7.general

    On Wed, 16 Jul 2025 22:14:28 +0100, Andy Burns wrote :


    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.

    Everyone has their own religious beliefs, and I have mine, so I won't
    chastise Zaidy036 for suggesting to use, aurgh, a Windows "search".

    Zaidy has helped me a lot over the years, so it's not an attack on him that
    my personal religious is to never need to use a search in decades on Win10.

    Not even once have I ever needed (nor should I) to surrender to a search.
    My opinion is if I have ot run a search, then I set up my PC the wrong way.

    Everything I need to do should be a single tap away.
    If it's not a single tap away, then I make it a single tap away.

    Which is what I did with the "hosts" command (and the "regopen" command),
    and with, oh, I don't know, hundreds of other obvious commands.

    But all that religiosity aside, I'm well aware that most people search.
    Hell, most people search to open an admin command line prompt!

    Instead of the three-fingered salute: Win+R > cmd {Ctrl+Shft+Enter}
    Why do something in two steps when you can easily do it in one step.

    Back to Andy's dilemma, I do not understand what is not working for Andy.

    If you make a shortcut to a scheduled task, if that scheduled task has the checkmark to run as administrator, it should edit. I haven't tried it but
    we should be able to edit the hosts file just by this TARGET:
    TARGET=C:\Windows\System32\schtasks.exe /run /TN "Task hosts edit"
    Where the task of editing the host would either be this simple...
    gvim.exe C:\windows\system32\drivers\etc\hosts
    Or, sometimes I find comspec works when things aren't all lined up.
    %comspec% /c "gvim.exe C:\windows\system32\drivers\etc\hosts"

    I don't see any reason why that wouldn't work - but - and this is important
    - I wasn't reading all the posts in this thread because I had solved this
    very problem so many decades ago that I had to look up how I solved it.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marion@21:1/5 to Marion on Sat Jul 19 03:08:51 2025
    XPost: alt.comp.os.windows-11, alt.windows7.general

    On Thu, 17 Jul 2025 01:52:23 -0000 (UTC), Marion wrote :


    Back to Andy's dilemma, I do not understand what is not working for Andy.

    Andy,
    What's not working.

    Maybe I can try it for you to help you out?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andy Burns@21:1/5 to Marion on Sun Jul 20 21:17:23 2025
    XPost: alt.comp.os.windows-11, alt.windows7.general

    Marion wrote:

    Back to Andy's dilemma, I do not understand what is not working for Andy.

    Andy,
    What's not working.
    Nothing. I just wonder why the shortcut method is apparently broken for
    John Gilliver

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From J. P. Gilliver@21:1/5 to All on Sun Jul 20 23:32:37 2025
    XPost: alt.comp.os.windows-11, alt.windows7.general

    T24gMjAyNS83LzIwIDIxOjE3OjIzLCBBbmR5IEJ1cm5zIHdyb3RlOg0KPiAgwqBNYXJpb24g d3JvdGU6DQo+IA0KPj4+IEJhY2sgdG8gQW5keSdzIGRpbGVtbWEsIEkgZG8gbm90IHVuZGVy c3RhbmQgd2hhdCBpcyBub3Qgd29ya2luZyBmb3IgDQo+Pj4gQW5keS4NCj4+DQo+PiBBbmR5 LA0KPj4gV2hhdCdzIG5vdCB3b3JraW5nLg0KPiBOb3RoaW5nLsKgIEkganVzdCB3b25kZXIg d2h5IHRoZSBzaG9ydGN1dCBtZXRob2QgaXMgYXBwYXJlbnRseSBicm9rZW4gZm9yIA0KPiBK b2huIEdpbGxpdmVyDQoNClNvIGRvIEksIGFzIHdoZW4gSSB0b29rIHRoZSAiIC9BIiBvdXQs IGl0IGNvbnRpbnVlZCB0byB3b3JrIQ0KLS0gDQpKLiBQLiBHaWxsaXZlci4gVU1SQTogMTk2 MC88MTk4NSBNQisrRygpQUwtSVMtQ2grKyhwKUFyQFQrSCtTaDAhOmApRE5BZg0KAA0KIkJv dGhlciwiIHNhaWQgUG9vaCwgYXMgaGUgdGFzdGVkIHRoZSBiYWNvbiBpbiBoaXMgc2FuZHdp Y2guDQo=

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)