• {rightclick} New | Text Document

    From Wolf Greenblatt@21:1/5 to All on Tue Oct 15 08:47:44 2024
    XPost: alt.comp.os.windows-11

    When I open a new text file, I just want it to open with some lines in it
    like this which would come from some kind of Microsoft Windows template.

    =============================================================================

    =============================================================================

    =============================================================================

    =============================================================================

    =============================================================================

    =============================================================================

    =============================================================================

    =============================================================================

    =============================================================================

    What is the Windows magic that will allow a rightclick context menu
    selection of "{rightclick} New | Text Document" to create those lines?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Big Al@21:1/5 to Wolf Greenblatt on Tue Oct 15 09:53:51 2024
    XPost: alt.comp.os.windows-11

    On 10/15/24 08:47 AM, Wolf Greenblatt wrote:
    When I open a new text file, I just want it to open with some lines in it like this which would come from some kind of Microsoft Windows template.

    <snip>
    What is the Windows magic that will allow a rightclick context menu
    selection of "{rightclick} New | Text Document" to create those lines?
    Try this link. Go down to the response that's had 75 up votes.

    https://superuser.com/questions/34704/how-can-i-add-an-item-to-the-new-context-menu
    --
    Linux Mint 21.3, Cinnamon 6.0.4, Kernel 5.15.0-122-generic
    Al

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Herbert Kleebauer@21:1/5 to Wolf Greenblatt on Tue Oct 15 16:43:37 2024
    XPost: alt.comp.os.windows-11

    On 15.10.2024 14:47, Wolf Greenblatt wrote:

    When I open a new text file, I just want it to open with some lines in it like this which would come from some kind of Microsoft Windows template.

    =============================================================================

    =============================================================================

    =============================================================================

    I would use a batch to put the text into the Windows clipboard:

    @echo off
    (for /l %%i in (1,1,10) do @echo ==============================&echo.)|clip

    Then, when editing a text file, just press <CTRL>-V (or <WIN>-V
    if you have added more content to the clipboard) to insert the lines
    at any position you like. The batch also could ask which one of
    a collection of templates it should put into the clipboard.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Newyana2@21:1/5 to Wolf Greenblatt on Tue Oct 15 11:26:02 2024
    XPost: alt.comp.os.windows-11

    On 10/15/2024 8:47 AM, Wolf Greenblatt wrote:

    What is the Windows magic that will allow a rightclick context menu
    selection of "{rightclick} New | Text Document" to create those lines?


    You can add items to the right-click menu fairly easily. I have lots
    of them to "Open With" specific programs. In this case, if it were me,
    I'd just make a file the way I want it, leave it on the Desktop, then doubleclick that when I want the template, saving it as something
    else. I actually do that with Libre Office docs. I have contract templates
    and receipt templates for my business. When I write a new one I just
    copy the template, rename it to the new file, then use that.

    That's also what MSWord does with templates. The only difference
    is that it enforces not saving the file as the original because it has
    an extension .DOT.

    You could do all sorts of things with something like VBScript. But
    none of it would be easier than just leaving your template on the Desktop.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Wolf Greenblatt@21:1/5 to Herbert Kleebauer on Tue Oct 15 13:04:08 2024
    XPost: alt.comp.os.windows-11

    Herbert Kleebauer wrote on Tue, 15 Oct 2024 16:43:37 +0200 :

    I would use a batch to put the text into the Windows clipboard:

    @echo off
    (for /l %%i in (1,1,10) do @echo ==============================&echo.)|clip

    Then, when editing a text file, just press <CTRL>-V (or <WIN>-V
    if you have added more content to the clipboard) to insert the lines
    at any position you like. The batch also could ask which one of
    a collection of templates it should put into the clipboard.

    That worked! Thanks!

    I created C:\batchfiles\cliptext.bat containing the 3 lines below.
    @echo off
    REM cliptext.bat cliptext.bat seeds clipboard for subsequent paste
    (for /l %%i in (1,1,10) do @echo &=============================================================================&echo.)|clip

    Clicking on the batch file worked, but to make it a run command I added
    this key to the registry to invoke it from the run box.
    HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\cliptext.exe
    Value: C:\batchfiles\cliptext.bat

    Subsequently typing "Win+R | cliptext" instantly seeds the clipboard.
    Hooray! Thanks!

    Oops.
    Since I will use it a lot, I also wanted to pin a shortcut to the taskbar.

    But when created a shortcut to that batch file, Windows wouldn't allow me
    to pin it to the taskbar.

    To get Windows to allow me to pin the shortcut pointing to that batch file
    to the taskbar, I changed the shortcut target from
    C:\batchfiles\cliptext.bat
    to
    %comspec% /c start "" C:\batchfiles\cliptext.bat
    which allowed me to pin that shortcut pointing to that batch file to the Windows taskbar.

    But that shortcut also left an orphan command window on the screen every
    time it's clicked.

    To try to get rid of the orphan command window, I changed the shortcut
    target line to
    C:\Windows\System32\schtasks.exe /run /TN "cliptext"
    and I changed the shortcut comment line to
    %comspec% /c start "" C:\batchfiles\cliptext.bat
    and then I added a taskschd.msc system scheduled task of
    Create Task
    Name: cliptext
    Description: cliptext.bat seeds clipboard for subsequent paste.
    Actions > New
    Action: Start a program
    Program/script: %comspec%
    Add arguments: /c start "" C:\batchfiles\cliptext.bat

    But the shortcut still brought up an extraneous orphan command window.
    I'm out of tricks to try to get the orphan command window to disappear.

    But the batch file & the run box call to that batch file works fine!
    Thanks.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul@21:1/5 to Wolf Greenblatt on Tue Oct 15 13:38:47 2024
    XPost: alt.comp.os.windows-11

    On Tue, 10/15/2024 8:47 AM, Wolf Greenblatt wrote:
    When I open a new text file, I just want it to open with some lines in it like this which would come from some kind of Microsoft Windows template.

    ============================================================================= 12345678901234567890123456789012345678901234567890123456789012345678901234567 =============================================================================

    =============================================================================

    =============================================================================

    =============================================================================

    =============================================================================

    =============================================================================

    =============================================================================

    =============================================================================

    What is the Windows magic that will allow a rightclick context menu
    selection of "{rightclick} New | Text Document" to create those lines?


    You did not say how many lines you wanted.

    Where is the interface going to be, to select the line count ?

    *******

    I could easily do that with Gawk.exe .

    BEGIN {
    { for (j=1; j<=9; j++) {
    for (i=1; i<=77; i++) printf("=")
    printf("\n\n")
    }
    }
    }

    gawk.exe -f lines.awk > output.txt

    *******

    [Picture]

    https://i.postimg.cc/Nf58KPSb/gawk-lines-awk.gif

    Paul

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Herbert Kleebauer@21:1/5 to Wolf Greenblatt on Wed Oct 16 00:44:55 2024
    XPost: alt.comp.os.windows-11

    On 15.10.2024 19:04, Wolf Greenblatt wrote:

    I created C:\batchfiles\cliptext.bat containing the 3 lines below.
    @echo off
    REM cliptext.bat cliptext.bat seeds clipboard for subsequent paste
    (for /l %%i in (1,1,10) do @echo &=============================================================================&echo.)|clip

    Clicking on the batch file worked, but to make it a run command I added
    this key to the registry to invoke it from the run box.
    HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\cliptext.exe

    But when created a shortcut to that batch file, Windows wouldn't allow me
    to pin it to the taskbar.

    Instead of messing around with shortcuts and the registry, I would
    use a small exe to start the batch. Execute the batch at the
    end of the posting to generate runbat.exe. If you execute
    runbat.exe a batch file with the same name in the same directory
    is executed.

    In your case, rename runbat.exe to cliptext.exe and your batch
    file to cliptext.exe.bat and store both files in the same directory.
    Now you can drag&drop cliptext.exe to the taskbar. If you click
    on it, cliptext.exe.bat is executed.

    The source code:

    winmain::
    jsr.l (GetCommandLine)

    eor.l r1,r1 ; not within "" flag
    move.l r0,r5
    move.l #name,r6
    _20: cmp.b #0,(r5)
    beq.b _10
    cmp.b #'"',(r5)
    bne.b _30
    not.l r1
    inc.l r5
    br.b _20
    _30: or.l r1,r1
    bne.b _40
    cmp.b #' ',(r5)
    beq.b _10
    _40: move.b (r5)+-,(r6)+-{s1}
    cmp.l #name_end,r6
    blo.b _20
    eor.l r0,r0
    br.b _100

    _10: move.l #'tab.',(r6)
    move.b #0,4.b(r6)

    moveq.l #1,-(sp) ; nShowCmd: 1 SW_SHOWNORMAL
    moveq.l #0,-(sp) ; lpDirectory
    moveq.l #0,-(sp) ; lpParameters
    move.l #name,-(sp) ; lpFile
    move.l #op,-(sp) ; lpOperation
    moveq.l #0,-(sp) ; hwnd
    jsr.l (ShellExecuteA)

    _100: move.l r0,-(sp)
    jsr.l (ExitProcess)

    op: dc.b "open",0
    name: blk.b 2000
    name_end:blk.b 10




    The binary:


    @echo off
    certutil -f -decode %~f0 runbat.exe>nul
    goto :eof

    -----BEGIN CERTIFICATE----- TVpgAQEAAAAEAAAA//8AAGABAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAoAAAAA4fug4AtAnNIbgBTM0hTmljZSB0byBtZWV0IHNvbWVi b2R5IHdobyBpcyBzdGlsbCB1c2luZyBET1MsDQpidXQgdGhpcyBwcm9ncmFtIHJl cXVpcmVzIFdpbjMyLg0KJFBFAABMAQEAUHmlNgAAAAAAAAAA4AAPAQsBBQwAAgAA AAAAAAAAAACuEAAAABAAAAAgAAAAAEAAABAAAAACAAAFAAAAAAAAAAQAAAAAAAAA ACAAAAACAAAAAAAAAgAAAAAAEAAAEAAAAAAQAAAQAAAAAAAAEAAAAAAAAAAAAAAA FBAAADwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAUAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALnRleHQAAADqCAAAABAAAAACAAAAAgAA AAAAAAAAAAAAAAAAIAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkEAAAAAAAAI4QAACgEAAA AAAAAFwQAAAAAAAAAAAAAFAQAAAAEAAAghAAAAAAAAAAAAAAdBAAAAgQAAAAAAAA AAAAAAAAAAAAAAAAAAAAAFNoZWxsMzIuZGxsAGQQAAAAAAAAAABTaGVsbEV4ZWN1 dGVBAEtFUk5FTDMyLmRsbAAAjhAAAKAQAAAAAAAAAABHZXRDb21tYW5kTGluZUEA AABFeGl0UHJvY2VzcwD/FQgQQAAx0onGvxARQACAPgB0IIA+InUF99JG6/EJ0nUF gD4gdA2kgf/gGEAAct8xwOsixwcuYmF0xkcEAGoBagBqAGgQEUAAaAsRQABqAP8V ABBAAFD/FQwQQABvcGVuAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAA==
    -----END CERTIFICATE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Herbert Kleebauer@21:1/5 to Herbert Kleebauer on Wed Oct 16 01:49:56 2024
    XPost: alt.comp.os.windows-11

    On 16.10.2024 00:44, Herbert Kleebauer wrote:
    On 15.10.2024 19:04, Wolf Greenblatt wrote:

    I created C:\batchfiles\cliptext.bat containing the 3 lines below.
    @echo off
    REM cliptext.bat cliptext.bat seeds clipboard for subsequent paste
    (for /l %%i in (1,1,10) do @echo &=============================================================================&echo.)|clip

    Clicking on the batch file worked, but to make it a run command I added
    this key to the registry to invoke it from the run box.
    HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\cliptext.exe

    But when created a shortcut to that batch file, Windows wouldn't allow me
    to pin it to the taskbar.

    Instead of messing around with shortcuts and the registry, I would
    use a small exe to start the batch.

    It is even much simpler. Just rename cliptext.bat to cliptext.exe,
    then you can drag&drop it to the taskbar. Then rename it back to
    cliptext.bat and right-click in the taskbar and change the link in
    properties also to cliptext.bat.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Wolf Greenblatt@21:1/5 to Herbert Kleebauer on Tue Oct 15 23:12:41 2024
    XPost: alt.comp.os.windows-11

    On Wed, 16 Oct 2024 01:49:56 +0200, Herbert Kleebauer wrote:

    But when created a shortcut to that batch file, Windows wouldn't allow me >>> to pin it to the taskbar.

    Instead of messing around with shortcuts and the registry, I would
    use a small exe to start the batch.

    It is even much simpler. Just rename cliptext.bat to cliptext.exe,
    then you can drag&drop it to the taskbar. Then rename it back to cliptext.bat and right-click in the taskbar and change the link in
    properties also to cliptext.bat.

    That worked! Thanks! You're full of Windows tricks.
    How do you learn them all!

    Your suggestion above is a really neat trick because Windows can pin a shortcut to an exe to the taskbar but not a shortcut to a batch file, so, with your trick, the bat is temporarily renamed as an exe whose shortcut gets pinned first to the taskbar and then it's a matter of tidying up the automatic
    changes to the target to get the now-pinned shortcut to point to the batch file!

    It worked like a charm. Now I can seed the "New | Text Document" by either "Win+R | cliptext" or clicking on the "cliptext.lnk" pinned to the taskbar.

    However - only after it worked did I realize there's an *EVEN SIMPLER WAY!*

    All I had to do was pin a link to *any* existing executable file,
    and edit that link's target line to point to C:\batchfiles\cliptext.bat

    Arbitrarily I picked to make a shortcut to Notepad++ on the taskbar
    and then I changed that shortcut's target to C:\batchfiles\cliptext.bat

    I could have made a link to anything actually, but I was already using Notepad++ so I used that link (plus the icon is ok as it w/o changing it).

    It's this simple:

    1. Pin *any* executable shortcut to the taskbar (for example, Notepad++)
    2. Change the shortcut target to C:\batchfiles\cliptext.bat

    That's it!

    This is the current content of C:\batchfiles\cliptext.bat

    @echo off
    REM cliptext.bat seeds the clipboard for subsequent pastes
    (for /l %%i in (1,1,10) do @echo &=============================================================================&echo.)|clip

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Herbert Kleebauer@21:1/5 to Wolf Greenblatt on Wed Oct 16 09:44:38 2024
    XPost: alt.comp.os.windows-11

    On 16.10.2024 05:12, Wolf Greenblatt wrote:

    It's this simple:

    1. Pin *any* executable shortcut to the taskbar (for example, Notepad++)

    But if you pin an exe (or a shortcut to an exe), which already has
    an icon, to the taskbar, you can't later change the icon in the taskbar.
    If you pin an exe without an icon, for example the renamed batch file (cliptext.bat -> cliptext.exe) to the taskbar, you can later add an
    icon (for example the standard icon with 4 horizontal lines) .

    2. Change the shortcut target to C:\batchfiles\cliptext.bat

    And change the icon to anything you like (but you can do this only
    once).

    That's it!

    This is the current content of C:\batchfiles\cliptext.bat

    @echo off
    REM cliptext.bat seeds the clipboard for subsequent pastes
    (for /l %%i in (1,1,10) do @echo &=============================================================================&echo.)|clip

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Newyana2@21:1/5 to Wolf Greenblatt on Wed Oct 16 08:52:26 2024
    XPost: alt.comp.os.windows-11

    On 10/15/2024 11:12 PM, Wolf Greenblatt wrote:

    I could have made a link to anything actually, but I was already using Notepad++ so I used that link (plus the icon is ok as it w/o changing it).

    It's this simple:

    1. Pin *any* executable shortcut to the taskbar (for example, Notepad++)
    2. Change the shortcut target to C:\batchfiles\cliptext.bat

    That's it!

    It's even simpler. Dump the pinning nonsense and use a Quick
    Launch toolbar, which then acts normally. Though this is cross-posted
    to Win10/11. I've heard that QL is broken on Win11.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Wolf Greenblatt@21:1/5 to Herbert Kleebauer on Wed Oct 16 16:31:52 2024
    XPost: alt.comp.os.windows-11

    On Wed, 16 Oct 2024 09:44:38 +0200, Herbert Kleebauer wrote:

    It's this simple:

    1. Pin *any* executable shortcut to the taskbar (for example, Notepad++)

    But if you pin an exe (or a shortcut to an exe), which already has
    an icon, to the taskbar, you can't later change the icon in the taskbar.

    Slowly I'm finding that out. You're way ahead of me!
    It's clear you've done this before so you know the gotchas that I don't.

    If you pin an exe without an icon, for example the renamed batch file (cliptext.bat -> cliptext.exe) to the taskbar, you can later add an
    icon (for example the standard icon with 4 horizontal lines).

    In hindsight, I agree with you. I should probably keep a dummy exe around
    so that I don't have to bother changing names though - but same thing.

    I have to pin an exe without an icon & then change the icon once,
    once that icon is pinned to the taskbar. Otherwise it screws up.


    2. Change the shortcut target to C:\batchfiles\cliptext.bat

    And change the icon to anything you like (but you can do this only
    once).

    Thanks for those caveats, where I think I'll name it clipseed.
    Or, maybe "seedclip" as it's seeding the clipboard with text.

    Thank you very much for your wonderful batch file to seed the clipboard.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Herbert Kleebauer@21:1/5 to Wolf Greenblatt on Sat Nov 9 16:35:31 2024
    On 09.11.2024 05:14, Wolf Greenblatt wrote:
    On Fri, 8 Nov 2024 21:53:12 +0100, Herbert Kleebauer wrote:

    I remove the cross post to alt.comp.os.windows-11 because I think,
    everybody who reads the Win11 group also reads the Win10 group
    (and because my Thunderbird refuses to do this cross post, I have
    to manually insert the second group in the posting stored in
    the Outbox).

    I also will split the answer in more postings to make it
    better readable.


    I simply export the App Paths key from one machine & load it into another.
    It just works.

    If you have to manually select just your entries, then this is
    not a "simply" task.


    You export from one machine. You import into the new machine.
    And all your commands work the same on both machines.

    But it is much more work than just editing the PATH. And you
    have to modify the registry every time you add or delete a
    utility.



    I simple click into the task bar brings it to foreground
    so you can enter the commands. But when using the AppPath method
    to register 1.exe, 2.exe and 3.exe you have to type "start 1",
    "start 2" or "start 3", 1, 2 or 3 works only with the PATH method.

    Each method works. Neither is "abuse" of the mechanism Microsoft provided.

    No, just typing 1,2 or 3 in a cmd window doesn't work if you
    use the AppPath method instead of PATH. CMD doesn't look into
    the registry.


    As the other guy already said, the best way to do this (using either
    method) is to write a script that has as input which template you want.
    command template1
    command template2
    command template3

    Not if there are just a few templates (because you have to type more).

    With your example:
    If 1.bat, 2.bat and 3.bat should insert 10, 20 or 30 separator lines.
    I would just make one batch file with the name 0.bat and this content:

    @echo off
    set /a n=%~n0% * 10
    if %n%==0 set /p n=How much lines?
    (for /l %%i in (1,1,%n%) do @echo ==============================&echo.)|clip pause

    Then generate 3 more names for the file:

    mklink /h 1.bat 0.bat
    mklink /h 2.bat 0.bat
    mklink /h 3.bat 0.bat

    It is still only one file but with four names. It doesn't matter
    which one you edit, the content is always identical.

    But if you start the batch by the name 1.bat, 10 lines are stored
    in the clipboard. 2.bat stores 20 and 3.bat 30 lines. If you start
    it by 0.bat, you are asked for the number.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Herbert Kleebauer@21:1/5 to Wolf Greenblatt on Sat Nov 9 16:37:34 2024
    On 09.11.2024 05:14, Wolf Greenblatt wrote:
    On Fri, 8 Nov 2024 21:53:12 +0100, Herbert Kleebauer wrote:



    What would be a neat trick, although I don't need it, is to populate the clipboard not with a "type file.txt | clip" but with a word document or an excel spreadsheet (where "type" won't likely work for those templates).

    A simple way would be to send the keystrokes <CTRL>-A <CRTL>-C <ALt>-F4
    to Word. This batch works with Word from Office 2007. Maybe you have
    to change the delay time for big docx files.


    @echo off
    if not exist skeyword.exe certutil -f -decode %~f0 skeyword.exe>nul
    start "" winword.exe test.docx
    :: wait for Word to start and load test.docx file
    timeout 10
    skeyword.exe
    ::del skeyword.exe
    ::pause
    goto :eof

    -----BEGIN CERTIFICATE----- TVpgAQEAAAAEAAAA//8AAGABAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAoAAAAA4fug4AtAnNIbgBTM0hTmljZSB0byBtZWV0IHNvbWVi b2R5IHdobyBpcyBzdGlsbCB1c2luZyBET1MsDQpidXQgaGlzIHByb2dyYW0gcmVx dWlyZXMgV2luMzIuDQokAFBFAABMAQEAUHmlNgAAAAAAAAAA4AAPAQsBBQwAAgAA AAAAAAAAAACgEAAAABAAAAAgAAAAAEAAABAAAAACAAAFAAAAAAAAAAQAAAAAAAAA ACAAAAACAAAAAAAAAwAAAAAAEAAAEAAAAAAQAAAQAAAAAAAAEAAAAAAAAAAAAAAA FBAAADwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAUAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALnRleHQAAACnAQAAABAAAAACAAAAAgAA AAAAAAAAAAAAAAAAIAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkEAAAAAAAAIoQAACSEAAA AAAAAFwQAAAAAAAAAAAAAFAQAAAAEAAAfhAAAAAAAAAAAAAAcBAAAAgQAAAAAAAA AAAAAAAAAAAAAAAAAAAAAFVTRVIzMi5kbGwAAGQQAAAAAAAAAABTZW5kSW5wdXQA S0VSTkVMMzIuZGxsAACKEAAAkhAAAAAAAAAAAFNsZWVwAAAARXhpdFByb2Nlc3MA vpcRQABoZAAAAP8VCBBAALkCAAAAv18RQACsCMAPhJMAAAA8PXUMuQEAAAC/XxFA AOvnPF51DLkBAAAAv3sRQADr1zw/dQ0xwKwIwHRoa8BkUOu2PDx1DrAQuQEAAAC/ XxFAAOs0PD51DrAQuQEAAAC/exFAAOsiPDp1DrARuQEAAAC/XxFAAOsQPDt1DLAR uQEAAAC/exFAAKJjEUAAon8RQABoHAAAAFdR/xUAEEAA6U////9qAFb/FQwQQAAB AAAARAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAEQAAAACAAAAAAAAAAAAAAAA AAAAAAAAADpBOz8UOkM7PxQ9EnNeEgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAA==
    -----END CERTIFICATE-----


    If you need to change the keys sent to word, edit the source
    code skeyword.mac and start the batch makeskeyword.bat, then
    the above batch is generated automatically. you will find
    both (and the assembler windela.exe) in:

    http://onlib.de/temp/skeyword.zip

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Herbert Kleebauer@21:1/5 to Wolf Greenblatt on Sat Nov 9 16:36:28 2024
    On 09.11.2024 05:14, Wolf Greenblatt wrote:
    On Fri, 8 Nov 2024 21:53:12 +0100, Herbert Kleebauer wrote:



    I never understood that (as it makes use of certificates) - but it works!
    showwin.exe 5
    del showwin.exe
    goto :eof

    -----BEGIN CERTIFICATE-----
    TVpgAQEAAAAEAAAA//8AAGABAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

    Some day I'll actually understand what you did in the above that works.

    It doesn't make use of certificates, it just uses the built-in base64
    decoder of certutil.exe. The base64 characters between

    -----BEGIN CERTIFICATE-----
    and
    -----END CERTIFICATE-----

    are converted back to binary and stored as an exe file. This way
    small exe programs can be embedded within the batch. showwin.exe
    just calls the ShowWindow function in USER32.dll with the
    parameter given in the command line.

    https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-showwindow

    winmain::
    jsr.l (GetCommandLine)
    ; skip program name
    eor.l r1,r1 ; not within "" flag
    dec.l r0
    _20: inc.l r0
    cmp.b #0,(r0)
    beq.b _10
    cmp.b #'"',(r0)
    bne.b _30
    not.l r1
    _30: or.l r1,r1
    bne.b _20
    cmp.b #' ',(r0)
    bne.b _20
    inc.l r0

    _10: eor.l r5,r5
    move.l #5,r4 ; default: SW_SHOW
    _50: movu.bl (r0),r1
    inc.l r0
    or.b r1,r1
    beq.b _40
    sub.b #'0',r1
    bcs.b _50
    cmp.b #9,r1
    bhi.b _50
    mulsq.l #10,r5,r5
    add.l r1,r5
    eor.l r4,r4
    br.b _50
    _40: or.l r4,r4
    beq.b _60
    move.l r4,r5

    _60: jsr.l (GetConsoleWindow)

    move.l r5,-(sp)
    move.l r0,-(sp)
    jsr.l (ShowWindow)

    moveq.l #0,-(sp)
    jsr.l (ExitProcess) ; exit program

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Zaidy036@21:1/5 to Wolf Greenblatt on Sat Nov 9 10:20:21 2024
    XPost: alt.comp.os.windows-11

    On 11/8/2024 11:14 PM, Wolf Greenblatt wrote:
    On Fri, 8 Nov 2024 21:53:12 +0100, Herbert Kleebauer wrote:

    How the App Paths Registry Key Makes Windows Both Faster and Safer
    https://helgeklein.com/blog/how-the-app-paths-registry-key-makes-windows-both-faster-and-safer/

    I don't see why it will make Windows "Faster and Safer".

    I don't either. All I know is when Microsoft gave us the System Registry, I studied how it works & one of the neat things I found was 'App Paths'. https://docs.revenera.com/installshield22helplib/helplibrary/IHelpAddAppPathsToComponent.htm

    I latched on to the convenience of the App Paths subkey & its portability. https://learn.microsoft.com/en-us/windows/win32/shell/app-registration

    This was so long ago that I don't remember if it was Windows XP or 95 or what, but I made scores of commands those days I'm still using today.

    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths
    Used to register an application for a single user

    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths
    Used to register an application for all users of the computer

    I simply export the App Paths key from one machine & load it into another.
    It just works. And I've been using literally that same key for decades. https://superuser.com/questions/1642149/what-does-hklm-software-microsoft-windows-currentversion-app-paths-actually-do

    You export from one machine. You import into the new machine.
    And all your commands work the same on both machines.

    Of course I also bring over my batch & link directories (which contain
    almost every script ever proposed on the Windows newsgroups, by the way).

    And, of course, you can screw with the PATH and they'd likely still work.
    But I have never touched the PATH on Windows in decades as I don't need to.

    Create a folder and add it to the PATH environment variable* (which is >>>> something you only need to do once). After that you can just drop any >>>> program or batch file into it and start it using the "run" dialog (or from a
    command console) - no "app path" fumbling needed anymore.

    The article cited explains why it's sophomoric to modify the PATH variable. >>
    There is nothing explained.

    Agree with you.

    You're different than that other guy who was just complaining so I didn't take him seriously. I take you seriously as you're not just complaining.

    You're trying to be critically constructive. And that's good. So am I.

    Many of my programs are those you wrote that I found on the archives for
    this newsgroup whenever I search for things - like your spelling program.

    I love that it gives me three chances to spell a word and if I get it
    right, then it removes the word from my misspelled word list.

    It's great! I think you wrote half the batch scripts that I've used,
    although others wrote them too (like Zaidy036) as I copy them verbatim and then when they work for me verbatim, I then modify them as needed.

    I think you wrote my sort program, for example, that sorts by microsecond. And I think you wrote the program I use that gets rid of the command
    console when I run commands which leave an unnecessary console in place.

    I never understood that (as it makes use of certificates) - but it works!
    showwin.exe 5
    del showwin.exe
    goto :eof

    -----BEGIN CERTIFICATE-----
    TVpgAQEAAAAEAAAA//8AAGABAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAoAAAAA4fug4AtAnNIbgBTM0hTmljZSB0byBtZWV0IHNvbWVi
    b2R5IHdobyBpcyBzdGlsbCB1c2luZyBET1MsDQpidXQgdGhpcyBwcm9ncmFtIHJl
    cXVpcmVzIFdpbjMyLg0KJFBFAABMAQEAUHmlNgAAAAAAAAAA4AAPAQsBBQwAAgAA
    AAAAAAAAAADIEAAAABAAAAAgAAAAAEAAABAAAAACAAAFAAAAAAAAAAQAAAAAAAAA
    ACAAAAACAAAAAAAAAwAAAAAAEAAAEAAAAAAQAAAQAAAAAAAAEAAAAAAAAAAAAAAA
    GBAAADwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAYAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALnRleHQAAAAmAQAAABAAAAACAAAAAgAA
    AAAAAAAAAAAAAAAAIAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABoEAAAAAAAAJQQAACmEAAA
    uhAAAAAAAABgEAAAAAAAAAAAAABUEAAAABAAAIQQAAAAAAAAAAAAAHYQAAAIEAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAABVU0VSMzIuZGxsAABoEAAAAAAAAAAAU2hvd1dp
    bmRvdwAAS0VSTkVMMzIuZGxsAACUEAAAphAAALoQAAAAAAAAAABHZXRDb21tYW5k
    TGluZUEAAABHZXRDb25zb2xlV2luZG93AAAAAEV4aXRQcm9jZXNzAP8VCBBAADHS
    SECAOAB0EYA4InUC99IJ0nXvgDggdepAMfa9BQAAAA+2EEAI0nQTgOowcvOA+gl3
    7mv2CgHWMe3r5QntdAKJ7v8VDBBAAFZQ/xUAEEAAagD/FRAQQAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAA==
    -----END CERTIFICATE-----

    Some day I'll actually understand what you did in the above that works.

    But for now, I just type "x" in my Runbox to open the directory and then I type the batch file that you wrote that runs what I need w/o the console!

    (I never put the two together so that the Runbox command would do both
    tasks of going to the directory and running the command - because it's NOT
    in the PATH since I never mess with the path - which takes us full circle.)

    The App Paths key provides a per-process PATH configuration which increases >>> security by eliminating the need to touch the global system PATH variable. >>
    Why does this increase security?

    I don't know. I was just trying to get rid of the guy who was complaining about how Microsoft does the PATH. I told him to complain to Bill Gates.

    I'm just using a feature of the PATH that I've been using for decades.
    It's why I never have to modify the PATH.

    A Windows App normally isn't just a single exe file but comes with a lot
    of additional files, so it needs its own program directory. If you have
    a lot of such Apps installed it would be indeed a stupid idea to add all
    these program directories to the PATH variable. On the other side, if
    you have dozens of single file utilities or batch files, then it would
    be stupid, to spread them all over the disk and use a Registry entry
    for each of them. Just put them all in a single command directory and
    add it to the PATH variable.

    That works too. But not every command is a batch file. Some are links.
    Links do things easily that batch files don't do as easily, although both
    can be made to do everything I'm sure.

    Where I use links is when I have to bring up the Windows task scheduler.

    Usually I do that only to run commands which need admin privileges.
    Or when I want to pin something to the taskbar that won't pin otherwise.

    I'm not using the App Paths for any other reason than convenience.
    And portability.

    Because the Windows App Paths key does more than just run batch files.

    When setting up a new PC, the first thing I do, is to copy this command
    directory to the new PC and modify the PATH variable. Then my collection
    of helper utilities is immediately available.

    Yup. I do something similar in that I set up all my concurrent machines and the new machine the same as I set it up on Windows XP and moved forward.

    Over time, of course, there are tweaks (for example, the executable for %Windir%\System32\curl.exe ifconfig.me didn't exist in early Windows 10),
    but essentially the App Paths key contains everything I run every day.

    We both accomplish that portability in a very consistent way.
    Only different.

    I never mess with the PATH. You do.
    You never mess with the App Paths subkey. I do.

    The end result is similar and only slightly different from your approach. Your approach is typical. Mine is perhaps not as typical. Both work.

    There are other methods also to find any given command on Windows. https://learn.microsoft.com/en-us/windows/win32/shell/app-registration

    When I want template #1 for example, I type "1" in the Runbox.
    When I want template #2, I type "2"; "3" for template #3, etc.

    Instead of typing <WIN>-R I prefer to have a CMD window open all
    the time.

    Rest assured I *never* type "Win+R". I just type that because most people don't know anything about the runbox so it makes it clear for *them*.

    I keep a runbox shortcut pinned to teh taskbar in a prominent spot.

    (I just added "prominent" to my spelling list you created, as I had spelled it "prominant" by mistake and it got squiggled so I added it to your list.)

    I simple click into the task bar brings it to foreground
    so you can enter the commands. But when using the AppPath method
    to register 1.exe, 2.exe and 3.exe you have to type "start 1",
    "start 2" or "start 3", 1, 2 or 3 works only with the PATH method.

    Each method works. Neither is "abuse" of the mechanism Microsoft provided.

    As the other guy already said, the best way to do this (using either
    method) is to write a script that has as input which template you want.
    command template1
    command template2
    command template3

    What would be a neat trick, although I don't need it, is to populate the clipboard not with a "type file.txt | clip" but with a word document or an excel spreadsheet (where "type" won't likely work for those templates).

    I don't have that script but if someone posts it, I'll use it.
    Most of my stuff is written by you & others like Zaidy03 <Eric@Bloch.com>.

    Thanks for the mention.
    If I was doing something similar I would use one batch and its first
    step would be to ask how many (0-9) , kill batch if 0 otherwise use the
    number to do what I want. Why have multiple batches when one will work
    and take less file space? The make a shortcut to start the batch and
    perhaps also a "Shortcut Key" which would give efficient activation.+

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Herbert Kleebauer@21:1/5 to Wolf Greenblatt on Sat Nov 9 16:38:25 2024
    On 09.11.2024 05:14, Wolf Greenblatt wrote:
    On Fri, 8 Nov 2024 21:53:12 +0100, Herbert Kleebauer wrote:



    Many of my programs are those you wrote that I found on the archives for
    this newsgroup whenever I search for things - like your spelling program.

    Maybe this calendar program is also useful. Depending on your
    date format you have to modify the 3 lines below. And you
    have to insert the birthdays of your friend at the end of the
    batch.


    @echo off
    :: MODE doesn't work in Win11
    :: MODE CON: COLS=40 LINES=40
    setlocal

    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    :: usage:
    :: kalender.bat show current month
    :: kalender.bat 9 show month september of current year
    :: kalender.bat 4 2007 show month april of year 2007 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    :: the format of the %date% variable must be in the following format:
    :: set date=28.02.2001
    :: if not, change the next three lines ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    set /a y=%date:~6,4%
    set /a m=1%date:~3,2%-100
    set /a d=1%date:~0,2%-100 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    :: test for parameter month
    if not [%1]==[] set /a m=%1
    if %m% lss 1 goto :eof
    if %m% gtr 12 goto :eof ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    :: test for parameter year
    if not [%2]==[] set /a y=%2
    if %y% lss 1901 goto :eof
    if %y% gtr 2100 goto :eof ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    :: calculate the string for the week numbers
    setlocal
    (set t= )
    for /l %%i in (1,7,29) do (
    set d=%%i
    call :date2week
    call set v= %%v%%
    call set v=%%v:~-2%%
    call set t=%%t%%%%v%%: )
    endlocal & (set t=%t% ) ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    :: calculate the name of the first day of month %m% 0:monday 7:sunday ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    call :date2day
    set /a w=(w-d+2)%%7

    set m[1]=Januar & set m[2]=Februar & set m[3]=Maerz & set m[4]=April
    set m[5]=Mai & set m[6]=Juni & set m[7]=Juli & set m[8]=August
    set m[9]=September&set m[10]=Oktober&set m[11]=November&set m[12]=Dezember

    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    :: calculate the number of days in the month %m% ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    set /a n=28+(62648012^>^>(2*%m%)^&3)+ (!(%y% %% 4))*(!(%m%-2))


    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    :: calculate the string for the days ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    (set s= )
    for /l %%i in (1,1,%w%) do (call set s= %%s%%)
    for /l %%i in (1,1,9) do if %%i EQU %d% (
    call set s=%%s%%[ %%i]) else (call set s=%%s%% %%i )
    for /l %%i in (10,1,%n%) do if %%i EQU %d% (
    call set s=%%s%%[%%i]) else (call set s=%%s%% %%i )

    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    :: output the calendar :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: echo.&echo.
    call echo %%m[%m%]%% %y%
    echo Mo Di Mi Do Fr Sa So
    for /l %%i in (1,28,141) do (call echo.%%t:~%%i,4%%%%s:~%%i,28%%)
    echo.


    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    :: output public holidays and bithdays ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    set /a month=m
    if %m% lss 10 set month=0%m%
    set /a m=3
    set /a d=1
    call :date2day
    call :ostern
    set /a o=w+o-1

    set i=.
    for /f "tokens=2,3* delims=. " %%i in ('find "::%i%"^<"%~f0"') do (
    set /a d=%%i
    set /a m=%%j
    set name=%%k
    call :sub)
    pause
    goto :eof


    :sub
    if not %m%==0 if %d%==0 echo.&goto :eof
    if %m% lss 10 set m=0%m%
    if %d% lss 10 set d=0%d%
    if [%m%]==[%month%] echo %d%.%m%.%y% %name%
    if not [%m%]==[00] goto :eof
    set /a w=o+%d%
    call :day2date
    if %m% lss 10 set m=0%m%
    if %d% lss 10 set d=0%d%
    if [%m%]==[%month%] echo %d%.%m%.%y% %name%
    goto :eof



    :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    :: calculate the date of eastern in the year %y% ::
    :: 1: 1. march 31: 31. march 32: 1. april ... :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    :ostern
    set /a i=((y%%19)*19+15+((y/100)*3+3)/4-((y/100)*8+13)/25)%%30
    set /a j=21+i-(i/29+(i/28-i/29)*((y%%19)/11))
    set /a o=j+7-(j-(7-(y+y/4+2-((y/100)*3+3)/4)%%7))%%7
    goto :eof

    :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    :: convert the date in %y% %m% %d% to the number of days (%w%) ::
    :: since 1901 (day 0 is 1. Jan. 1901) :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    :date2day
    set /a w=(y-1901)*365+(y-1901)/4+d-1+(!(y %% 4))*(!((m-3)^&16))
    set /a w=w+(m-1)*30+2*(!((m-7)^&16))-1+((65611044^>^>(2*m))^&3)
    goto :eof

    :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    :: convert the number of days in %w% to the date (%y% %m% %d%) :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    :day2date
    set /a x=w/1461
    set /a w=w-x*1461
    set /a z=w/365-((w/365)^>^>2)
    set /a w=w-z*365
    set /a y=1901+x*4+z
    set /a v=w-!(y%%4)
    set /a m=!!(w/31)+!!(v/59)+!!(v/90)+!!(v/120)+!!(v/151)+!!(v/181)
    set /a m=m+!!(v/212)+!!(v/243)+!!(v/273)+!!(v/304)+!!(v/334)+1
    set /a d=w+1-(!(y%%4))*(!((m-3)^&16))
    set /a d=d-((m-1)*30+2*(!((m-7)^&16))-1+((65611044^>^>(2*m))^&3))
    goto :eof

    :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    :: calculate the week number %v% for the date (%y% %m% %d%) :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    :date2week
    setlocal
    call :date2day
    set i=%w%
    set d=1
    set m=1
    call :date2day
    set /a n=(w+1)%%7
    set /a v=!(n/4)
    set /a v=v+(i-w+n)/7

    if %v% gtr 0 goto :d2w1
    set v=53
    if %n%==4 goto :d2w2
    set /a y=y-1
    call :date2day
    set /a n=(w+1)%%7
    if %n%==3 goto :d2w2
    set v=52
    goto :d2w2

    :d2w1
    if %v% leq 52 goto :d2w2
    if %n%==3 goto :d2w2
    set /a y=y+1
    call :date2day
    set /a n=(w+1)%%7
    if %n%==4 goto :d2w2
    set v=1

    :d2w2
    endlocal & set v=%v%
    goto :eof

    :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    :: insert holidays and birthdays here ::
    :: format: ::. day.month. description ::
    :: if month==0 then day is the offset to eastern :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

    ::. 1.1. Neujahr
    ::. 6.1. Hl. 3 Koenige
    ::. 14.2. Valentinstag
    ::.-48.0. Rosenmontag
    ::.-47.0. Faschingsdienstag
    ::. -2.0. Karfreitag
    ::. -1.0. Karsamstag
    ::. 0.0. Ostersonntag
    ::. 1.0. Ostermontag
    ::. 1.5. Maifeiertag
    ::. 39.0. Christi Himmelfahrt
    ::. 49.0. Pfingstsonntag
    ::. 50.0. Pfingstmontag
    ::. 60.0. Fronleichnam
    ::. 15.8. Maria Himmelfahrt
    ::. 3.10. Tag d. dt. Einheit
    ::. 1.11. Allerheiligen
    ::. 24.12. Heiligabend
    ::. 25.12. 1. Weihnachtstag
    ::. 26.12. 2. Weihnachtstag
    ::. 31.12. Silvester

    ::. 0.1. just an empty line

    ::. 3.1. Emilia
    ::. 16.1. Noah
    ::. 22.1. Emma
    ::. 27.1. Leon
    ::. 12.2. Mia
    ::. 22.2. Liam
    ::. 22.2. Lina
    ::. 10.3. Leo
    ::. 16.3. Ella
    ::. 19.3. Milan
    ::. 20.3. Mila
    ::. 22.4. Emil
    ::. 27.4. Malia
    ::. 27.4. Felix
    ::. 2.5. Leni
    ::. 10.5. Luca
    ::. 19.5. Amelie
    ::. 8.6. Theo
    ::. 12.6. Leonie
    ::. 28.6. Matteo
    ::. 6.7. Luna
    ::. 15.7. Paul
    ::. 18.7. Hannah
    ::. 29.7. Emilio
    ::. 14.8. Sophie
    ::. 23.8. Henry
    ::. 3.9. Amalia
    ::. 12.9. David
    ::. 10.10. Sophia
    ::. 2.11. Jonas
    ::. 27.11. Charlotte
    ::. 11.12. Oskar
    ::. 11.12. Hanna
    ::. 24.12. Maximilian
    ::. 30.12. Lena

    ::. 0.1. just an empty line

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Wolf Greenblatt@21:1/5 to Herbert Kleebauer on Thu Nov 7 22:42:38 2024
    XPost: alt.comp.os.windows-11

    On Sun, 27 Oct 2024 08:53:33 +0100, Herbert Kleebauer wrote:

    I have sometimes wanted to copy the whole contents of a command window
    and save it in a file. A "tee" program is usually not sufficient. I
    managed to do it with a mouse macro program, but a single command would
    be ideal.

    But with the new terminal window in WIN11 it is as simple as in
    any GUI Windows program. Do a <SHIFT> mouse click on the
    first character you want to copy, then scroll down the window
    and do a <SHIFT> mouse click on the last character you want to
    copy and then a <CTRL>-C to store it in the clipboard.

    Thanks to Herbert Kleebauer's prior suggestions, I have a series of template-creating batch files now, all invoked easily in a Runbox.

    When I want template #1 for example, I type "1" in the Runbox.
    When I want template #2, I type "2"; "3" for template #3, etc.

    All the batch files are the same - they just seed a different template into
    the Windows clipboard using the "pipe to clip" Herbert had suggested.

    HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\1.exe
    @Default = c:\path\seedclip_template1.bat HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\2.exe
    @Default = c:\path\seedclip_template2.bat HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\3.exe
    @Default = c:\path\seedclip_template3.bat

    Where the general form of the "seed to clip" for templates is
    Win+R > 1
    Which then seeds the clipboard with template1.txt

    @echo off
    REM This seeds the Windows clipboard for subsequent pastes
    type C:\path\template1.txt|clip

    When you are in any file, you just type "1" into the Runbox,
    and then you Control+V the template from the clipboard into it.

    The nice thing is you can create delimiter templates of any length with subsequent pastes, so you only really need one set of delimiters.
    @echo off
    REM seedclip.bat seeds the Windows clipboard for subsequent pastes
    (for /l %%i in (1,1,10) do @echo =============================================================================&echo.)|clip

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Fri Nov 8 09:07:43 2024
    XPost: alt.comp.os.windows-11

    Wolf,

    HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\1.exe
    @Default = c:\path\seedclip_template1.bat

    What is this preoccupation with the abuse of that "app paths" registry key ?


    Create a folder and add it to the PATH environment variable* (which is something you only need to do once). After that you can just drop any
    program or batch file into it and start it using the "run" dialog (or from a command console) - no "app path" fumbling needed anymore.

    * or, if you do not mind making a mess of things, just pick a folder thats mentioned in that PATH environment variable.

    The second nice thing about it is that, when you remove a program/batchfile from that folder, you not also need to remember to remove the "app paths" registry key for it.


    Personally I've added a folder as a submenu to the "start" button. Easy to reach and I can just pick the program/batchfile/script/shortcut** I need, instead of having to remember its exact name - using one-letter filenames
    might be good to minimize keystrokes, but having a descriptive filename
    helps you to remember what it actually does.

    ** which, ofcourse, allows you to execute a (single) program with
    (different) arguments.

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Wolf Greenblatt@21:1/5 to R.Wieser on Fri Nov 8 09:14:51 2024
    XPost: alt.comp.os.windows-11

    On Fri, 8 Nov 2024 09:07:43 +0100, R.Wieser wrote:

    HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\1.exe
    @Default = c:\path\seedclip_template1.bat

    What is this preoccupation with the abuse of that "app paths" registry key ?

    How the App Paths Registry Key Makes Windows Both Faster and Safer https://helgeklein.com/blog/how-the-app-paths-registry-key-makes-windows-both-faster-and-safer/

    Create a folder and add it to the PATH environment variable* (which is something you only need to do once). After that you can just drop any program or batch file into it and start it using the "run" dialog (or from a command console) - no "app path" fumbling needed anymore.
    * or, if you do not mind making a mess of things, just pick a folder thats mentioned in that PATH environment variable.

    The article cited explains why it's sophomoric to modify the PATH variable.

    The App Paths key provides a per-process PATH configuration which increases security by eliminating the need to touch the global system PATH variable.

    The second nice thing about it is that, when you remove a program/batchfile from that folder, you not also need to remember to remove the "app paths" registry key for it.

    The App Paths registry key fixes itself when you remove its default target.

    Personally I've added a folder as a submenu to the "start" button. Easy to reach and I can just pick the program/batchfile/script/shortcut** I need, instead of having to remember its exact name - using one-letter filenames might be good to minimize keystrokes, but having a descriptive filename
    helps you to remember what it actually does.

    ** which, ofcourse, allows you to execute a (single) program with
    (different) arguments.

    I have all my menus pinned to the taskbar which access every program that I need to access via organized shortcuts with specific target attributes.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Fri Nov 8 17:30:07 2024
    XPost: alt.comp.os.windows-11

    Wolf,

    The article cited explains why it's sophomoric to modify the PATH
    variable.

    You mean this : "Getting more technical, modifying the system path is
    not exactly best practice since it may slow down the system, break other applications and even create security holes." ? Thats mostly FUD.

    If you don't know what you're doing* than /almost everything/ is a
    security risk.

    I forgot to mention: Using the "app path" method suffers the same security
    risk as what I quoted in the above quote. If you "app path" a program and I drop a program of the same name in any folder on the PATH than my program, instead of yours, will run.

    IOW, They have "spotted a problem" and just stopped thinking.

    At least, I hope that that is what happened, and not yet another ... person
    who enjoys maliciously trolling others.

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Fri Nov 8 17:18:20 2024
    XPost: alt.comp.os.windows-11

    Wolf,

    What is this preoccupation with the abuse of that "app paths" registry
    key ?

    How the App Paths Registry Key Makes Windows Both Faster and Safer

    Faster ? While you are the delaying factor when you enter the filename ?

    Safer ? Indeed, but only in very specific circumstances (take a look at, mentioned in the link, the folder firefox is in, and you will probably understand the problem of having all those files in the searchpath).

    IOW, neither applies to what you use it for.

    The article cited explains why it's sophomoric to modify the PATH
    variable.

    You mean this : "Getting more technical, modifying the system path is not exactly best practice since it may slow down the system, break other applications and even create security holes." ? Thats mostly FUD.

    If you don't know what you're doing* than /almost everything/ is a security risk.

    Also, as app paths are the last one in that five-point list, using them will
    be as slow you can get. :-p :-)

    * think about where you need to put that extra folder path so other programs won't break and it won't create security holes. Its really not rocket
    science.

    The App Paths key provides a per-process PATH configuration which
    increases security by eliminating the need to touch the global
    system PATH variable.

    The problem there is in what they *don't* say (see above). IOW, again FUD.

    The App Paths registry key fixes itself when you remove its default
    target.

    It does ? So it holds your hand in case you forget to revert something you purposely did before.

    Though that still leaves that you have to add it.

    I have all my menus pinned to the taskbar which access every program
    that I need to access via organized shortcuts with specific target attributes.

    You could have put that folder I spoke of there too, and do away with all
    that "app path" fumbling - and it stays secure, as the folder isn't in the PATH.

    Regards,
    Rudy Wieser

    P.s.
    You can tell the "new" menu entries to start a program* instead of copying
    the template file.

    * which could be a (scripted?) menu allowing you to select whatever template you want for that specific filetype. Or dump it into the clipboard if thats your preference.

    No "app path" fumbling, no PATH environment variable (percieved) security risks, nothing. :-)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Wolf Greenblatt@21:1/5 to R.Wieser on Fri Nov 8 13:58:05 2024
    XPost: alt.comp.os.windows-11

    On Fri, 8 Nov 2024 17:18:20 +0100, R.Wieser wrote:

    You can tell the "new" menu entries to start a program* instead of copying the template file.

    * which could be a (scripted?) menu allowing you to select whatever template you want for that specific filetype. Or dump it into the clipboard if thats your preference.

    You seem inordinately upset about how Microsoft designed Windows paths.
    Go write your complaint to Microsoft.

    Tell them you don't like the way they implemented paths in Windows.
    Maybe they'll do something about the App Paths key then.

    Maybe they'll delete it in Windows 12.
    But it has been around since the registry so don't hold your breath.

    It's there to use by people who benefit from using it.
    That's me. But not you.

    And that's OK.
    But don't blame me because of how Microsoft implemented paths.

    Blame Microsoft instead.

    Using the "app path" method suffers the same security risk as what I
    quoted in the above quote. If you "app path" a program and I
    drop a program of the same name in any folder on the PATH than my program, instead of yours, will run.

    Everyone who uses the App Paths method knows how the Windows path works.

    You're just learning it now perhaps.
    But everyone runs a quick test *before* they create a new App Paths key.

    If something is in the path, they change the key until it's available.

    If you're actually worried someone is sneaking on your system writing executables that you then accidentally run, then you have bigger problems
    than complaining that Microsoft designed Windows paths not to your liking.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Herbert Kleebauer@21:1/5 to Wolf Greenblatt on Fri Nov 8 21:53:12 2024
    XPost: alt.comp.os.windows-11

    On 08.11.2024 15:14, Wolf Greenblatt wrote:
    On Fri, 8 Nov 2024 09:07:43 +0100, R.Wieser wrote:

    HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\1.exe
    @Default = c:\path\seedclip_template1.bat

    What is this preoccupation with the abuse of that "app paths" registry key ?

    How the App Paths Registry Key Makes Windows Both Faster and Safer https://helgeklein.com/blog/how-the-app-paths-registry-key-makes-windows-both-faster-and-safer/

    I don't see why it will make Windows "Faster and Safer".


    Create a folder and add it to the PATH environment variable* (which is
    something you only need to do once). After that you can just drop any
    program or batch file into it and start it using the "run" dialog (or from a >> command console) - no "app path" fumbling needed anymore.

    The article cited explains why it's sophomoric to modify the PATH variable.

    There is nothing explained.


    The App Paths key provides a per-process PATH configuration which increases security by eliminating the need to touch the global system PATH variable.

    Why does this increase security?


    A Windows App normally isn't just a single exe file but comes with a lot
    of additional files, so it needs its own program directory. If you have
    a lot of such Apps installed it would be indeed a stupid idea to add all
    these program directories to the PATH variable. On the other side, if
    you have dozens of single file utilities or batch files, then it would
    be stupid, to spread them all over the disk and use a Registry entry
    for each of them. Just put them all in a single command directory and
    add it to the PATH variable.

    When setting up a new PC, the first thing I do, is to copy this command directory to the new PC and modify the PATH variable. Then my collection
    of helper utilities is immediately available.



    When I want template #1 for example, I type "1" in the Runbox.
    When I want template #2, I type "2"; "3" for template #3, etc.

    Instead of typing <WIN>-R I prefer to have a CMD window open all
    the time. I simple click into the task bar brings it to foreground
    so you can enter the commands. But when using the AppPath method
    to register 1.exe, 2.exe and 3.exe you have to type "start 1",
    "start 2" or "start 3", 1, 2 or 3 works only with the PATH method.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Fri Nov 8 22:18:13 2024
    XPost: alt.comp.os.windows-11

    Wolf,

    You can tell the "new" menu entries to start a program* instead of
    copying
    the template file.

    * which could be a (scripted?) menu allowing you to select whatever
    template
    you want for that specific filetype. Or dump it into the clipboard if
    thats
    your preference.

    You seem inordinately upset about how Microsoft designed Windows paths.
    Go write your complaint to Microsoft.

    Lol ? I thought I was giving you another option there. One which would
    give you the possibility to create a per-extension template choosing.

    It's there to use by people who benefit from using it.
    That's me. But not you.

    You're not very bright, are you ?

    That I would not use them like you do doesn't mean my machine doesn't use
    them at all. I mean, I even gave you the example of FireFox and how it
    would not be a good idea to have its folder in the PATH. Yes, FireFox uses
    an "App Path" entry. Just as a number of other programs do.

    Maybe they'll delete it in Windows 12.
    But it has been around since the registry so don't hold your
    breath.

    I know. And your "it slows down everything" is from way-back-when too. You know, when processor speed was measured in MegaHertz and memory in
    MegaBytes.

    As for me holding my breath ? Why should I do that ? If you think that you /have/ to use that "app path" than please do so. All I did was to show you that its more work than a few of the alternatives.

    And yes, you're abusing that "app path". The fact that you create the "app path" with an .EXE extension when you target a batch file should tell you
    that. But again, if you think you should use it anyway than be my guest.

    Using the "app path" method suffers the same security risk as what
    I quoted in the above quote. If you "app path" a program and I
    drop a program of the same name in any folder on the PATH than my
    program, instead of yours, will run.

    Everyone who uses the App Paths method knows how the Windows path works.

    Don't lie to me kid. If you would have you would not have pointed me to
    some website claiming changing the PATH is dangerous - and not explain it yourself - while ignoring that using that "app path" has the same problem.

    But everyone runs a quick test *before* they create a new App Paths key.

    Lol. A "quick test" of *what* ? You're just throwing some empty - and therefore meaningless - crap around.

    Also, When you throw that "Everybody" claim around you're signalling, with a bullhorn, that you're trying to blow some hot air in what you say, not that
    you have actually talked to just a fraction of that "Everybody" - not even
    in your own city.

    Just think of it: if you would talk with just 1 million persons (no doubt
    just a fraction of your countries inhabitants) for five minutes each with no pauses you would need 5.000.000 minutes. A workday is 8*60 => 480 minutes.
    You would need 5.000.000 / 480 => 10416.6~ workdays, which is 2083.3~ 5-day weeks, which is just over 40 years. You do not even sound that old - and
    yes, I'm ignoring that the first decade or two of a persons life (s)he's not really a working person.

    If you're actually worried someone is sneaking on your system
    writing executables that you then accidentally run,

    :-) Funny: You point to a security problem in when someone would touch the PATH environment variable, but when I point out that that same problem
    already exists exists in your own situation you suffenly try to make it
    sound as if I am pointing out some quite silly.

    You're really not very bright, are you ? The example I gave was, as
    mentioned, valid for both situations. By telling me that a same-named executable being dropped into a folder on the PATH is rediculous you also
    shot down the whole "security risk" claim in that link of yours.

    And no, you can't have it both ways.

    Bottom line:

    Yes, I'm annoyed with people who abuse(!) the "app path" method. I have
    shown you several ways to do without them and in the process make everything simpler (and also a suggestion to let a "new" item launch a menu from which
    you can chose your template - not /that/ simple).

    You don't want to use them ? Thats fully upto you.

    But do yourself a favour and don't try to push stuff you do not seem to know much of anything about* as the best thing since sliced bread.

    * you have not even /tried/ to support the claims in that link of yours, nor where you aware that those claims where rather one-sided.

    ... Or, when you do and when you come to the realisation that you did so on incomplete and/or incorrect information (for whatever reason), be gracious about it. I'm not someone who has any urge to pummel someone who does so.

    Besides, I have no idea where you live. :-)

    Regards,
    Rudy Wieser.

    P.s.

    You're just learning it now perhaps.

    Thats the nice thing about the internet: it doesn't matter how young or old
    you are or how long or short ago you started with learning something.
    Knowledge is knowledge, regardless of age of the wielder or when it was acquired. :-)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Wolf Greenblatt@21:1/5 to R.Wieser on Fri Nov 8 20:24:21 2024
    XPost: alt.comp.os.windows-11

    On Fri, 8 Nov 2024 22:18:13 +0100, R.Wieser wrote:

    You seem inordinately upset about how Microsoft designed Windows paths.
    Go write your complaint to Microsoft.

    Lol ? I thought I was giving you another option there. One which would
    give you the possibility to create a per-extension template choosing.

    Oh. I'm sorry. I thought you called the use of App Paths "abuse".
    No problem then. I agree it would be nice to have better methods.
    But I've been using the App Paths key since Windows XP days.
    Maybe even Windows 95 days. I don't remember when I started.

    So I'm sorry if I assailed you.
    I thought you said it was "abuse" to use it the way Microsoft designed it.

    Please accept my sincere apologies.

    It's there to use by people who benefit from using it.
    That's me. But not you.

    You're not very bright, are you ?

    That I would not use them like you do doesn't mean my machine doesn't use them at all. I mean, I even gave you the example of FireFox and how it
    would not be a good idea to have its folder in the PATH. Yes, FireFox uses an "App Path" entry. Just as a number of other programs do.

    I agree with you that not only do other programs make use of the App Paths
    key, even the venerable Irfanview does it seems, but they do other stuff.

    The App Paths key's capabilities are more complex than the way I use them.
    If you know more about those capabilities, that would be useful to discuss.

    Maybe they'll delete it in Windows 12.
    But it has been around since the registry so don't hold your
    breath.

    I know. And your "it slows down everything" is from way-back-when too. You know, when processor speed was measured in MegaHertz and memory in
    MegaBytes.

    As for me holding my breath ? Why should I do that ? If you think that you /have/ to use that "app path" than please do so. All I did was to show you that its more work than a few of the alternatives.

    And yes, you're abusing that "app path". The fact that you create the "app path" with an .EXE extension when you target a batch file should tell you that. But again, if you think you should use it anyway than be my guest.

    Regarding how much "work" it is to add an app paths entry, it's no work for
    me to add a new "command" simply by adding a new App Paths entry to it.

    Let's say I wanted a command to start and stop the printer spooler for
    example, where I wanted that command to be called "spooler" in the Runbox.

    1. I'd create a batch file (called anything, but let's call it spool.bat).
    2. When I test that in the run box, it opens C:\Windows\System32\spool
    3. So I try "spooler" instead - which does nothing in the Run box. Good.

    Now that I have my command, I go to the App Paths key and I add it.
    1. Regedit > App Paths > I add the new key "spooler.exe"
    2. That key points to my batch file (which can be called anything)

    Now I have a new command called "spooler" which runs the print spooler.
    It's that easy.

    Are there other ways to do it?
    Sure.

    But when it comes time to migrate to another machine, I just export the App Paths key from one PC and load it into another PC & it's all there for me.

    Of course, I also copy over the directory I keep all my batch files in too.
    And my shortcuts (many of which are used to invoke the Task Scheduler).

    Be advised the print spooler requires administrative privileges so the App
    Path key doesn't point to a batch file but to a Task Scheduler link.

    That task scheduler entry points to the batch file (but these are just details).

    Can I do all that magic using the Windows system PATH?
    Sure.

    That's the beauty of Windows. Lots of ways to do things we do all day.
    Thank Microsoft for that.

    Using the "app path" method suffers the same security risk as what
    I quoted in the above quote. If you "app path" a program and I
    drop a program of the same name in any folder on the PATH than my
    program, instead of yours, will run.

    Everyone who uses the App Paths method knows how the Windows path works.

    Don't lie to me kid. If you would have you would not have pointed me to
    some website claiming changing the PATH is dangerous - and not explain it yourself - while ignoring that using that "app path" has the same problem.

    But everyone runs a quick test *before* they create a new App Paths key.

    Lol. A "quick test" of *what* ? You're just throwing some empty - and therefore meaningless - crap around.

    See above where I ran a quick test of "spool" which showed me that it was unsuitable for the App Paths key but "spooler" was still available for use.

    Also, When you throw that "Everybody" claim around you're signalling, with a bullhorn, that you're trying to blow some hot air in what you say, not that you have actually talked to just a fraction of that "Everybody" - not even
    in your own city.

    Just think of it: if you would talk with just 1 million persons (no doubt just a fraction of your countries inhabitants) for five minutes each with no pauses you would need 5.000.000 minutes. A workday is 8*60 => 480 minutes. You would need 5.000.000 / 480 => 10416.6~ workdays, which is 2083.3~ 5-day weeks, which is just over 40 years. You do not even sound that old - and yes, I'm ignoring that the first decade or two of a persons life (s)he's not really a working person.

    WTF?

    If you're actually worried someone is sneaking on your system
    writing executables that you then accidentally run,

    :-) Funny: You point to a security problem in when someone would touch the PATH environment variable, but when I point out that that same problem already exists exists in your own situation you suffenly try to make it
    sound as if I am pointing out some quite silly.

    You're really not very bright, are you ? The example I gave was, as mentioned, valid for both situations. By telling me that a same-named executable being dropped into a folder on the PATH is rediculous you also shot down the whole "security risk" claim in that link of yours.

    And no, you can't have it both ways.

    When a Windows user wishes to create a new command for the Runbox, he can choose to put it in the PATH (which is designed for general purpose use) or
    he can choose to put it in the App Paths key which was designed for that specific purpose.

    Your choice.
    And mine.

    Both have pros and cons, like everything else in Windows does.

    Bottom line:

    Yes, I'm annoyed with people who abuse(!) the "app path" method.

    OK. I thought so. You think understanding how Windows works is abuse.
    That's fine. Keep thinking that. It doesn't change the PATH others take.

    I have
    shown you several ways to do without them and in the process make everything simpler (and also a suggestion to let a "new" item launch a menu from which you can chose your template - not /that/ simple).

    You don't want to use them ? Thats fully upto you.
    But do yourself a favour and don't try to push stuff you do not seem to know much of anything about* as the best thing since sliced bread.

    * you have not even /tried/ to support the claims in that link of yours, nor where you aware that those claims where rather one-sided.

    ... Or, when you do and when you come to the realisation that you did so on incomplete and/or incorrect information (for whatever reason), be gracious about it. I'm not someone who has any urge to pummel someone who does so.

    I took the PATH less traveled by. And that has made all the difference.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Wolf Greenblatt@21:1/5 to Herbert Kleebauer on Fri Nov 8 23:14:17 2024
    XPost: alt.comp.os.windows-11

    On Fri, 8 Nov 2024 21:53:12 +0100, Herbert Kleebauer wrote:

    How the App Paths Registry Key Makes Windows Both Faster and Safer
    https://helgeklein.com/blog/how-the-app-paths-registry-key-makes-windows-both-faster-and-safer/

    I don't see why it will make Windows "Faster and Safer".

    I don't either. All I know is when Microsoft gave us the System Registry, I studied how it works & one of the neat things I found was 'App Paths'. https://docs.revenera.com/installshield22helplib/helplibrary/IHelpAddAppPathsToComponent.htm

    I latched on to the convenience of the App Paths subkey & its portability. https://learn.microsoft.com/en-us/windows/win32/shell/app-registration

    This was so long ago that I don't remember if it was Windows XP or 95 or
    what, but I made scores of commands those days I'm still using today.

    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths
    Used to register an application for a single user

    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths
    Used to register an application for all users of the computer

    I simply export the App Paths key from one machine & load it into another.
    It just works. And I've been using literally that same key for decades. https://superuser.com/questions/1642149/what-does-hklm-software-microsoft-windows-currentversion-app-paths-actually-do

    You export from one machine. You import into the new machine.
    And all your commands work the same on both machines.

    Of course I also bring over my batch & link directories (which contain
    almost every script ever proposed on the Windows newsgroups, by the way).

    And, of course, you can screw with the PATH and they'd likely still work.
    But I have never touched the PATH on Windows in decades as I don't need to.

    Create a folder and add it to the PATH environment variable* (which is
    something you only need to do once). After that you can just drop any
    program or batch file into it and start it using the "run" dialog (or from a
    command console) - no "app path" fumbling needed anymore.

    The article cited explains why it's sophomoric to modify the PATH variable.

    There is nothing explained.

    Agree with you.

    You're different than that other guy who was just complaining so I didn't
    take him seriously. I take you seriously as you're not just complaining.

    You're trying to be critically constructive. And that's good. So am I.

    Many of my programs are those you wrote that I found on the archives for
    this newsgroup whenever I search for things - like your spelling program.

    I love that it gives me three chances to spell a word and if I get it
    right, then it removes the word from my misspelled word list.

    It's great! I think you wrote half the batch scripts that I've used,
    although others wrote them too (like Zaidy036) as I copy them verbatim and
    then when they work for me verbatim, I then modify them as needed.

    I think you wrote my sort program, for example, that sorts by microsecond.
    And I think you wrote the program I use that gets rid of the command
    console when I run commands which leave an unnecessary console in place.

    I never understood that (as it makes use of certificates) - but it works!
    showwin.exe 5
    del showwin.exe
    goto :eof

    -----BEGIN CERTIFICATE-----
    TVpgAQEAAAAEAAAA//8AAGABAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAoAAAAA4fug4AtAnNIbgBTM0hTmljZSB0byBtZWV0IHNvbWVi
    b2R5IHdobyBpcyBzdGlsbCB1c2luZyBET1MsDQpidXQgdGhpcyBwcm9ncmFtIHJl
    cXVpcmVzIFdpbjMyLg0KJFBFAABMAQEAUHmlNgAAAAAAAAAA4AAPAQsBBQwAAgAA
    AAAAAAAAAADIEAAAABAAAAAgAAAAAEAAABAAAAACAAAFAAAAAAAAAAQAAAAAAAAA
    ACAAAAACAAAAAAAAAwAAAAAAEAAAEAAAAAAQAAAQAAAAAAAAEAAAAAAAAAAAAAAA
    GBAAADwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAYAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALnRleHQAAAAmAQAAABAAAAACAAAAAgAA
    AAAAAAAAAAAAAAAAIAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABoEAAAAAAAAJQQAACmEAAA
    uhAAAAAAAABgEAAAAAAAAAAAAABUEAAAABAAAIQQAAAAAAAAAAAAAHYQAAAIEAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAABVU0VSMzIuZGxsAABoEAAAAAAAAAAAU2hvd1dp
    bmRvdwAAS0VSTkVMMzIuZGxsAACUEAAAphAAALoQAAAAAAAAAABHZXRDb21tYW5k
    TGluZUEAAABHZXRDb25zb2xlV2luZG93AAAAAEV4aXRQcm9jZXNzAP8VCBBAADHS
    SECAOAB0EYA4InUC99IJ0nXvgDggdepAMfa9BQAAAA+2EEAI0nQTgOowcvOA+gl3
    7mv2CgHWMe3r5QntdAKJ7v8VDBBAAFZQ/xUAEEAAagD/FRAQQAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAA==
    -----END CERTIFICATE-----

    Some day I'll actually understand what you did in the above that works.

    But for now, I just type "x" in my Runbox to open the directory and then I
    type the batch file that you wrote that runs what I need w/o the console!

    (I never put the two together so that the Runbox command would do both
    tasks of going to the directory and running the command - because it's NOT
    in the PATH since I never mess with the path - which takes us full circle.)

    The App Paths key provides a per-process PATH configuration which increases >> security by eliminating the need to touch the global system PATH variable.

    Why does this increase security?

    I don't know. I was just trying to get rid of the guy who was complaining
    about how Microsoft does the PATH. I told him to complain to Bill Gates.

    I'm just using a feature of the PATH that I've been using for decades.
    It's why I never have to modify the PATH.

    A Windows App normally isn't just a single exe file but comes with a lot
    of additional files, so it needs its own program directory. If you have
    a lot of such Apps installed it would be indeed a stupid idea to add all these program directories to the PATH variable. On the other side, if
    you have dozens of single file utilities or batch files, then it would
    be stupid, to spread them all over the disk and use a Registry entry
    for each of them. Just put them all in a single command directory and
    add it to the PATH variable.

    That works too. But not every command is a batch file. Some are links.
    Links do things easily that batch files don't do as easily, although both
    can be made to do everything I'm sure.

    Where I use links is when I have to bring up the Windows task scheduler.

    Usually I do that only to run commands which need admin privileges.
    Or when I want to pin something to the taskbar that won't pin otherwise.

    I'm not using the App Paths for any other reason than convenience.
    And portability.

    Because the Windows App Paths key does more than just run batch files.

    When setting up a new PC, the first thing I do, is to copy this command directory to the new PC and modify the PATH variable. Then my collection
    of helper utilities is immediately available.

    Yup. I do something similar in that I set up all my concurrent machines and
    the new machine the same as I set it up on Windows XP and moved forward.

    Over time, of course, there are tweaks (for example, the executable for %Windir%\System32\curl.exe ifconfig.me didn't exist in early Windows 10),
    but essentially the App Paths key contains everything I run every day.

    We both accomplish that portability in a very consistent way.
    Only different.

    I never mess with the PATH. You do.
    You never mess with the App Paths subkey. I do.

    The end result is similar and only slightly different from your approach.
    Your approach is typical. Mine is perhaps not as typical. Both work.

    There are other methods also to find any given command on Windows. https://learn.microsoft.com/en-us/windows/win32/shell/app-registration

    When I want template #1 for example, I type "1" in the Runbox.
    When I want template #2, I type "2"; "3" for template #3, etc.

    Instead of typing <WIN>-R I prefer to have a CMD window open all
    the time.

    Rest assured I *never* type "Win+R". I just type that because most people
    don't know anything about the runbox so it makes it clear for *them*.

    I keep a runbox shortcut pinned to teh taskbar in a prominent spot.

    (I just added "prominent" to my spelling list you created, as I had spelled
    it "prominant" by mistake and it got squiggled so I added it to your list.)

    I simple click into the task bar brings it to foreground
    so you can enter the commands. But when using the AppPath method
    to register 1.exe, 2.exe and 3.exe you have to type "start 1",
    "start 2" or "start 3", 1, 2 or 3 works only with the PATH method.

    Each method works. Neither is "abuse" of the mechanism Microsoft provided.

    As the other guy already said, the best way to do this (using either
    method) is to write a script that has as input which template you want.
    command template1
    command template2
    command template3

    What would be a neat trick, although I don't need it, is to populate the clipboard not with a "type file.txt | clip" but with a word document or an excel spreadsheet (where "type" won't likely work for those templates).

    I don't have that script but if someone posts it, I'll use it.
    Most of my stuff is written by you & others like Zaidy03 <Eric@Bloch.com>.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Sat Nov 9 10:22:14 2024
    XPost: alt.comp.os.windows-11

    Wolf,

    Lol ? I thought I was giving you another option there. One which would
    give you the possibility to create a per-extension template choosing.

    Oh. I'm sorry. I thought you called the use of App Paths "abuse".

    Yes, I did. Multiple times. For several reasons.

    But you mean you can just post a quote and than talk about something totally different ? That would be ... definitely un-nice.

    I agree it would be nice to have better methods.

    I've offered you several ones.

    But I've been using the App Paths key since Windows XP days.
    Maybe even Windows 95 days. I don't remember when I started.

    I can understand that that methods has worn a path into you, and its
    momentum pushes you to continue in the same direction it has always gone.
    It doesn't mean your choosen method is (still) good, nor that you should propagate it to others.

    So I'm sorry if I assailed you.
    I thought you said it was "abuse" to use it the way Microsoft designed it.

    The thing is that you *didn't* use it the way Microsoft designed it. You definitily abusing it, in fact and in spirit.

    But thats not even why I responded. The un-needed work (per command) was
    what did it.

    The App Paths key's capabilities are more complex than the way I
    use them.

    Not really.

    If you know more about those capabilities, that would be useful to
    discuss.

    This is what MS has to say about it:

    https://learn.microsoft.com/en-us/windows/win32/shell/app-registration#using-the-app-paths-subkey

    What it does are just two things, mentioned under "If the name of a subkey
    of App Paths matches the file name, the Shell performs two actions"

    There are some "special handling of input" modifiers available though., as mentioned in the table under "See the following table for details of the App Paths subkey entries".

    Regarding how much "work" it is to add an app paths entry, it's no
    work for me to add a new "command" simply by adding a new App Paths
    entry to it.

    Thats two things: Creating the "command" *and* adding an "app path" to it.
    My suggested method only needs you, after a single set-up, to do the first.

    .... and you're just lucky that MS has (recently? Always ?) recognised that people would forget to remove the "app path" registry key after they remove
    the "command", and continiously tries to clean up that registry key.
    Otherwise they would be introducing slow-downs themselves, having a
    gazillion of "app paths" in there that point nowhere anymore. <whistle>

    But when it comes time to migrate to another machine, I just export
    the App Paths key from one PC and load it into another PC & it's all
    there for me.

    In my case I would just do

    a single edit of the PATH environment variable

    - or -

    drop the START buttons sub-menu into place

    - or -

    add the folder the "commands" are in to the quick-launch area (on the
    taskbar)

    - or any combination thereof -

    and be done with it.

    Also, I would be a bit carefull with just importing that exported "App
    paths" key. Before you know it you overwrite an already existing entry with something thats not valid for your new machine ...

    In fact, I would suggest you to remove, from that exported "app paths" key, anything entry not pointing to your own "commands" - which would be easy if
    you have placed them all in a special folder. (I hope you see what I did there. Quite nefarious, don't you think so ? :-) )

    Or write a somerhing which only imports "app paths" items when they do not already exist. Personally I would still balk at that, as you could stil be adding items for programs that do not exist on your new machine, but as it seems to do an automatic cleanup that won't be a problem for long.

    Also, When you throw that "Everybody" claim around you're signalling,
    with a
    bullhorn, that you're trying to blow some hot air in what you say, not
    that
    you have actually talked to just a fraction of that "Everybody" - not
    even
    in your own city.

    Just think of it: if you would talk with just 1 million persons (no doubt
    just a fraction of your countries inhabitants) for five minutes each with
    no
    pauses you would need 5.000.000 minutes. A workday is 8*60 => 480
    minutes.
    You would need 5.000.000 / 480 => 10416.6~ workdays, which is 2083.3~
    5-day
    weeks, which is just over 40 years. You do not even sound that old - and
    yes, I'm ignoring that the first decade or two of a persons life (s)he's
    not
    really a working person.

    WTF?

    Just some simple calculus to show you that when someone uses "everyone" (or
    its opposite, "noone") they are being definitily untruthfull, as they have
    no way of knowing it - because of simple time limitations.

    When a Windows user wishes to create a new command for the Runbox,
    he can choose to put it in the PATH (which is designed for general
    purpose use)

    No, he can't. Just like you can't put (a reference to) a folder into the
    "app paths"

    or he can choose to put it in the App Paths key which was designed
    for that specific purpose.

    Nope, it definitily wasn't designed for your specific purpose. You're
    abusing it in fact *and* spirit.

    Yes, I'm annoyed with people who abuse(!) the "app path" method.

    OK. I thought so. You think understanding how Windows works is
    abuse. That's fine. Keep thinking that.

    :-) You're quite thick-skulled, are you.

    I can use a hammer to ram a screw into some wood, and a screwdriver as a crowbar to pry a nail outof it. That doesn't mean that that is their
    intended use, or even if its something you should be doing.

    It doesn't change the PATH others take.

    The "the PATH others take" ? Whats that to be supposed to be referencing ?

    Also, I gave you several solutions that do not use the PATH at all, yet for some reason you still stuck on it. Why ?

    And lets not forget that I already made clear that your percieved problems
    with using the PATH environment variable are also present with your use of
    the "app paths" method.


    ... and it gets even worse :-D

    When you read MS own take on "App Paths" (in the link I gave you) you might notice the second thing it does:

    [quote]
    The Path entry for that subkey is ***pre-pended*** to the PATH environment variable of that process.
    [/quote]

    (bolding done by me).

    And yes, that means that your preferred solution creates the "security
    problem" and "could break other programs" You think using the PATH would
    cause. Especially when you call a batchfile. <whoops!> :-)

    I took the PATH less traveled by.

    That you did.

    And that has made all the difference.

    And that it does. But as far as I can tell, not for the better.

    Though as I said, you just keep doing you. Its your 'puter after all.

    But when you post it as "a great method" than do not be surprised when
    someone like me comes along, and points out some ... inconsistencies.

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Wolf Greenblatt@21:1/5 to All on Mon Nov 25 17:50:41 2024
    XPost: alt.comp.os.windows-11

    On Sat, 9 Nov 2024 10:20:21 -0500, Zaidy036 wrote:

    Most of my stuff is written by you & others like Zaidy03 <Eric@Bloch.com>.

    Thanks for the mention.
    If I was doing something similar I would use one batch and its first
    step would be to ask how many (0-9) , kill batch if 0 otherwise use the number to do what I want. Why have multiple batches when one will work
    and take less file space? The make a shortcut to start the batch and
    perhaps also a "Shortcut Key" which would give efficient activation.+

    Thanks for noticing. I keep in my REM comments the name of the person
    who helped as I've tried at least once probably every script posted
    to this ng.

    Thanks for contributing to the newsgroup so we can find your stuff
    when we search the archives for your name and some related batch
    keyword!

    This one, for example, is by you based on the comments in the file.

    @echo off
    REM nettoggle.bat by Zaidy036 20210207 on alt.comp.os.windows-10
    REM Win10 network on/off toggle with admin privileges, Feb 7, 2021
    REM https://groups.google.com/g/alt.msdos.batch/c/sDNRLfXlUHo
    REM With an attempt to get admin privileges programmatically
    REM https://stackoverflow.com/questions/22367173/get-default-gateway-from-batch-file
    REM for /f "tokens=1-5" %%a in ('route -4 print 0.*') do @if "%%e"=="" if "%%a"=="%%b" set "ip=%%c"

    :: Verify permissions
    nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"

    :: On Error No Admin
    if '%errorlevel%' NEQ '0' (
    echo Getting administrative privileges...
    goto DoUAC
    ) else ( goto getAdmin )

    :DoUAC
    echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
    set params = %*:"=""
    echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs"

    "%temp%\getadmin.vbs"
    del "%temp%\getadmin.vbs"
    exit /B

    :getAdmin
    pushd "%CD%"
    CD /D "%~dp0"
    REM
    set defgw=192.168.0.1
    set "ip="
    for /f "tokens=2,3 delims={,}" %%a in ('"WMIC NICConfig where IPEnabled="True" get DefaultIPGateway /value | find "I" "') do if not defined ip set ip=%%~a
    IF "%ip%"=="%defgw%" ( %comspec% /c %windir%\system32\route.exe delete 0.0.0.0 %defgw%) ELSE ( %comspec% /c %windir%\system32\route.exe add 0.0.0.0 mask 0.0.0.0 %defgw%)
    exit

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Wolf Greenblatt@21:1/5 to Herbert Kleebauer on Mon Nov 25 18:04:40 2024
    XPost: alt.comp.os.windows-11, alt.msdos.batch

    On Mon, 25 Nov 2024 22:42:09 +0100, Herbert Kleebauer wrote:

    On 09.11.2024 05:14, Wolf Greenblatt wrote:

    Many of my programs are those you wrote that I found on the archives for
    this newsgroup whenever I search for things - like your spelling program.

    I love that it gives me three chances to spell a word and if I get it
    right, then it removes the word from my misspelled word list.

    Just found out, that it doesn't work properly in Win11, you have to
    insert a small pause before the word is spoken:

    cscript //nologo speak.vbs "<silence msec='700'/> %*"

    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: >:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

    @echo off
    :: you have to create spell.txt with the words to be spoken
    :: enter x to terminate program

    chcp 65001>nul
    :: win11 Terminal doesn't support mode con
    :: MODE CON: COLS=50 LINES=10
    :: color f0
    cls

    ::echo createobject("sapi.spvoice").speak wsh.arguments(0)>speak.vbs

    :: or with rate/volume specified
    echo Set sapi = createObject("sapi.spvoice") >speak.vbs
    echo sapi.Rate = -3 >>speak.vbs
    ::echo sapi.Volume = 100 >>speak.vbs
    echo sapi.Speak wsh.arguments(0) >>speak.vbs

    for /f "tokens=*" %%i in (spell.txt) do call echo %%random%% %%i>>spellerr.txt
    sort /o spelltmp.txt spellerr.txt
    del spellerr.txt
    set /a ok=0
    set /a not_ok=0

    for /f "tokens=1*" %%i in (spelltmp.txt) do call :sub %%j
    :end
    del speak.vbs
    del spelltmp.txt
    echo.
    echo %ok% Wörter richtig, %not_ok% Wörter falsch
    echo.
    pause
    exit

    :sub
    echo.
    set /a n=0
    :sub1
    set /a n=n+1
    if %n%==3 goto :sub2
    :: https://learn.microsoft.com/en-us/previous-versions/windows/desktop/ms717077(v=vs.85)
    cscript //nologo speak.vbs "<silence msec='700'/> %*"
    set a=
    set /p a=
    if /i "%a%"=="x" goto :end
    if /i not "%*"=="%a%" goto :sub1
    set /a ok=ok+1
    goto :eof

    :sub2
    echo 0 %*>>spellerr.txt
    echo ---------- %*
    set /a not_ok=not_ok+1
    timeout /t 2 >nul

    Thanks for that update. I'm on Windows 10 so I wasn't aware of this change. I'll fix mine so that when I move to Windows 11, it will still work.
    The way I run it is I have an app paths key called "spell".

    So I bring up the Runbox and then I type "spell" to add a squiggled word.
    HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\
    spell.exe = C:\path-to\spelltxt.txt

    Then when I have time, type "bee" to test my personal spelling errors.
    HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\
    bee.exe = C:\path-to\spellingbee.bat

    @echo off
    REM spellingbee.bat for Windows 10, originally by Herbert Kleebauer 20220211
    REM A self-test of redsquiggled words with a self-reinforcing misspelled DB.
    REM Newsgroups: alt.comp.os.windows-10,alt.msdos.batch,alt.usage.english
    REM Message-ID: <su5ifp$300$1@gioia.aioe.org>
    REM Customized for only the words that YOU misspell (just yours!)
    REM Randomly speaks thos words giving you a chance to type them correctly.
    REM Strategy being it _must_ be quick & easy; otherwise you won't do it.
    REM Purposefully uses audio instead of a visual to present the word.
    REM Strategically, this uses a visual to reinforce the correct spelling.
    REM Logic being that seeing it _before_ trying to spell it taints memory.
    REM Logic being seeing it _after_ an attempt tends to reinforce memory.
    REM Tactic is auto-honing of just the words _you_ have recently misspelled.
    REM Tactic is repetition specifically for the words _you_ misspelled most.
    REM Recommended one-time setup:
    REM 1. Set up an AppPath for a quick command: "Run > spell"
    REM (Use that command to add redsquiggled words into spelltxt.txt)
    REM HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\
    REM spell.exe = C:\data\database\tts\spelltxt.txt
    REM 2. Set up an AppPath for a quick command: "Run > spellingbee"
    REM (Use that command to initiate the audio-visual testing process)
    REM HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\
    REM spellingbee.exe = C:\data\database\tts\spellingbee.bat
    REM 3. Optionally, choose a filespecs for the spell txt, err & tmp files
    REM Note any explicit path is optional (it can be %TEMP% as the default).
    REM spelltxt.txt is manually maintained redsquiggled words (1 per line)
    REM spelltxt.err is a dynamic error file autocreated & automaintained
    REM spelltxt.tmp is a dynamic tmp file autocreated by this script
    REM Note: %TEMP% defaults to C:\Users\<username>\AppData\Local\Temp\
    REM Recommended daily-use model
    REM 4. Ad hoc, as words are redsquiggled, rightclick, correct & copy...
    REM Run > spell
    REM Paste the now-correctly-spelled redsquiggle into that spell.txt file
    REM Note: Most people pin a "Run" shortcut icon to their Win10 taskbar.
    REM Note: Otherwise, they press "Windows+R" to pop up the Run box.
    REM 5. Periodically, as needed, to refresh & reinforce spelling memory...
    REM Run > spellingbee
    REM a. Speaks words you previously doubly misspelled (in spellerr.txt)
    REM (if you spell it incorrectly, another entry is added)
    REM (if you spell it correctly, only one entry is removed)
    REM b. Then randomly speaks the list of misspelled words (in spelltxt.txt)
    REM (if you spell it incorrectly, one entry is added to the error file)
    REM (if you spell it correctly, it moves to the next word in the file)
    REM The more you misspell a word, the more it shows up in the error file.
    REM Each time a word is presented you have two chances to spell it out.
    REM The more you correctly spell it, the less it shows up.
    REM When incorrect, a "pause" allows timely introspection of errors.
    REM Pressing "x" will end the session (as will pressing "Control+C").
    REM
    REM Please choose a desired filespec for the spelling text, error & temp files.
    REM set spelltxtfile=%TEMP%\spelltxt.txt
    REM set spellerrfile=%TEMP%\spellerr.txt
    REM set spelltmpfile=%TEMP%\spelltmp.txt
    set spelltxtfile=C:\data\database\tts\spelltxt.txt
    set spellerrfile=C:\data\database\tts\spellerr.txt
    set spelltmpfile=C:\data\database\tts\spelltmp.txt
    MODE CON: COLS=50 LINES=10
    color f0
    cls
    echo createobject("sapi.spvoice").speak wsh.arguments(0)>speak.vbs

    for /f "tokens=*" %%i in (%spelltxtfile%) do call echo %%random%% %%i>>%spellerrfile%
    sort /o %spelltmpfile% %spellerrfile%
    del %spellerrfile%
    set /a ok=0
    set /a not_ok=0

    for /f "tokens=1*" %%i in (%spelltmpfile%) do call :sub %%j
    :end
    del speak.vbs
    del %spelltmpfile%
    echo.
    echo %ok% words correct, %not_ok% words incorrect
    echo.
    pause
    exit

    :sub
    echo.
    set /a n=0
    :sub1
    set /a n=n+1
    if %n%==3 goto :sub2
    cscript //nologo speak.vbs "%*"
    set a=
    set /p a=
    if /i "%a%"=="x" goto :end
    if /i not "%*"=="%a%" goto :sub1
    set /a ok=ok+1
    goto :eof

    :sub2
    echo 0 %*>>%spellerrfile%
    echo ---------- %*
    timeout /t 4 >nul
    set /a not_ok=not_ok+1

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