• A label won't start as Admin with a space-containing argument.

    From Anton Shepelev@21:1/5 to All on Wed Dec 18 18:45:54 2024
    Hello, all.

    I have simple test batch file names test.bat and located under C:\TEMP\

    @ECHO OFF
    ECHO 1: %1
    ECHO 2: %2
    ECHO 3: %3
    PAUSE

    I created a label on my desktop with the following text in the target field:

    C:\Temp\test.bat one two

    Now when I click on the label, it shows a cmd window with:

    1: one
    2: two

    And the same happends if a I run this label as Administrator via the
    context menu. When, however, I change the invocation to:

    C:\Temp\test.bat one "two"

    it still works when run by double-click, printing:

    1: one
    2: "two"

    but does not work when started via the conext menu as Administrator,
    in which case no cmd window appears.

    Why won't it run as Administrator with the second argument enclosed
    in double quotes?

    --
    () ascii ribbon campaign -- against html e-mail
    /\ www.asciiribbon.org -- against proprietary attachments

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stan Brown@21:1/5 to Anton Shepelev on Wed Dec 18 16:33:16 2024
    On Wed, 18 Dec 2024 18:45:54 +0300, Anton Shepelev wrote:
    I have simple test batch file names test.bat and located under C:\TEMP\

    @ECHO OFF
    ECHO 1: %1
    ECHO 2: %2
    ECHO 3: %3
    PAUSE

    I created a label on my desktop with the following text in the target field:

    C:\Temp\test.bat one two

    Now when I click on the label, it shows a cmd window with:

    1: one
    2: two

    Really? No third line with "3:"? That's what I get.

    --
    Stan Brown, Tehachapi, California, USA https://BrownMath.com/
    Shikata ga nai...

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anton Shepelev@21:1/5 to All on Thu Dec 19 14:16:39 2024
    Stan Brown to Anton Shepelev:

    I have simple test batch file names test.bat and located
    under C:\TEMP\

    @ECHO OFF
    ECHO 1: %1
    ECHO 2: %2
    ECHO 3: %3
    PAUSE

    I created a label on my desktop with the following text
    in the target field:

    C:\Temp\test.bat one two

    Now when I click on the label, it shows a cmd window
    with:

    1: one
    2: two

    Really? No third line with "3:"? That's what I get.

    I beg pardon, it is an editing mistake: I started testing
    with test.bat printing the first three parameters, but
    finding that two were enough I removed the third ECHO call
    yet forgot to do the same in the message draft. Now I see
    that the culprit is not a space in an argument, but the use
    of double quotes to escape it, for the error remains with:

    C:\Temp\test.bat "one"

    I still do not understand why a lablel with this target
    won't start the bat file when invoked via
    /Run as Administrator/.

    --
    () ascii ribbon campaign -- against html e-mail
    /\ www.asciiribbon.org -- against proprietary attachments

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