[TC9.51] Command line does truncate under Windows XP

Please report only one bug per message!

Moderators: white, Hacker, petermad, Stefan2

Post Reply
andry81
Junior Member
Junior Member
Posts: 97
Joined: 2018-11-22, 19:17 UTC

[TC9.51] Command line does truncate under Windows XP

Post by *andry81 »

Tested on `Windows XP x64 SP2` and `Windows XP x86 SP3`.

To reproduce:
  1. Create directory: `c:\1 2 3 4 5 6 7 8 9 0\.123456789.123456789.123456789.123456789.123456789.123456789`
  2. Create shortcut: `c:\1 2 3 4 5 6 7 8 9 0\.123456789.123456789.123456789.123456789.123456789.123456789\cmd.lnk` to the `C:\WINDOWS\System32\cmd.exe`
  3. Create a button:

    Code: Select all

    cmd=c:\1 2 3 4 5 6 7 8 9 0\.123456789.123456789.123456789.123456789.123456789.123456789\cmd.lnk
    param=/C @"c:\1 2 3 4 5 6 7 8 9 0\.123456789.123456789.123456789.123456789.123456789.123456789\01234567890123456789.bat" -0123456789 -0123456789 -0123456789 -0123456789 -0123456789 -0123456789 -0123456789 -0123456789 "%P\."
  4. Create the `01234567890123456789.bat` script:

    Code: Select all

    @echo off
    
    setlocal
    
    echo -
    echo %0 %*
    echo -
    
    pause
    
The result of execution:

Code: Select all

-
"c:\1 2 3 4 5 6 7 8 9 0\.123456789.123456789.123456789.123456789.123456789.12345
6789\01234567890123456789.bat" -0123456789 -0123456789 -0123456789 -0123456789 -
0123456789 -0123456789 -0123456789 -0123456789 "c:\1 2 3 4 5 6 7 8 9 0\.12345678
9.123456789.1
-
The `Windows 7 x64 SP1` does not have that issue.

If run the command manually from the console:

Code: Select all

C:\1 2 3 4 5 6 7 8 9 0\.123456789.123456789.123456789.123456789.123456789.123456789>C:\WINDOWS\System32\cmd.exe /C @"c:\1 2 3 4 5 6 7 8 9 0\.123456789.123456789.123456789.123456789.123456789.123456789\01234567890123456789.bat" -0123456789 -0123456789 -0123456789 -0123456789 -0123456789 -0123456789 -0123456789 -0123456789 "c:\1 2 3 4 5 6 7 8 9 0\.123456789.123456789.123456789.123456789.123456789.123456789\."
Then result is correct.

As I understand correctly the length of the initial parameters list is around 255 characters:

Code: Select all

@"c:\1 2 3 4 5 6 7 8 9 0\.123456789.123456789.123456789.123456789.123456789.123456789\01234567890123456789.bat" -0123456789 -0123456789 -0123456789 -0123456789 -0123456789 -0123456789 -0123456789 -0123456789 "c:\1 2 3 4 5 6 7 8 9 0\.123456789.123456789.1
So the issue might be inside the TC parser.

PS: If try to replace the shortcut with the `C:\WINDOWS\System32\cmd.exe`, then the issue is not reproducible.
Last edited by andry81 on 2021-02-03, 19:34 UTC, edited 1 time in total.
User avatar
elgonzo
Power Member
Power Member
Posts: 866
Joined: 2013-09-04, 14:07 UTC

Re: [TC9.51] Command line does truncate under Windows XP

Post by *elgonzo »

Uh... your console test is not exactly equivalent with your Toolbar button test.
Differently executed tests tend to result in different outcomes. Your conclusion is not holding water, because it is based on the unverified expectation that two different tests must have the same outcome.


For the TC button test, you execute

Code: Select all

c:\1 2 3 4 5 6 7 8 9 0\.123456789.123456789.123456789.123456789.123456789.123456789\cmd.lnk
However, for the console test, you execute:

Code: Select all

C:\WINDOWS\System32\cmd.exe
(Note: I am not saying that this is definitely the explanation for what you see. I am not sure whether this discrepancy would cause the different outputs you see. Maybe it does, maybe it does not. But the only conclusion that can be drawn from this is that the two tests differ. You can't draw any conclusion regarding a perceived problem with TC from that...)


It seems you haven't done the test in a manner where both the toolbar button and the console test invoke the .lnk file. Unless you execute both tests in exactly the same manner - both with the .lnk file, i call your conclusion into question.


(Side note with regard to your P.S.: See, if you execute both the TC toolbar button and the console test in exactly the same manner, you get exactly the same results. Now do it once more, but this time both the TC button and the console test using the .lnk file instead of cmd.exe, and compare the results...)
Last edited by elgonzo on 2021-02-02, 07:12 UTC, edited 2 times in total.
Begrudgingly back to Windows... now 11... sigh... but i have no nerve for Linux desktop anymore...
andry81
Junior Member
Junior Member
Posts: 97
Joined: 2018-11-22, 19:17 UTC

Re: [TC9.51] Command line does truncate under Windows XP

Post by *andry81 »

elgonzo wrote: 2021-02-02, 06:52 UTC Uh... your console test is not exactly equivalent with your Toolbar button test.
Yes, you are right, seems this is a bug in the Windows XP.
Post Reply