I've tested it and 11.51 still has this "bug".2Mapaler
I would have noticed that a long time ago. TC 11.03? Check on 11.51.
And which program cannot handle that?
- .Net Framwork 4.8 And .Net 8
Image: https://imgur.la/image/1655-TotalCMD64-Total-Commander-%28x64%29-11.03-David-Attie.iBraa
Image: https://imgur.la/image/1656-TotalCMD64-Total-Commander-%28x64%29-11.03-David-Attie.iB63pCode:
static void Main(string[] args){ MessageBox.Show(String.Join(" ", args));}
- Visual Basic 6
Image: https://imgur.la/image/1657-TotalCMD64-Total-Commander-%28x64%29-11.03-David-Attie.iBOSO
There is no native support for parameter parsing, so you need to call the API.Code:
Private Declare Function GetCommandLineW Lib "kernel32" () As LongPrivate Declare Function CommandLineToArgvW Lib "shell32.dll" (ByVal lpCmdLine As Long, pNumArgs As Long) As LongPrivate Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal length As Long)Private Declare Function LocalFree Lib "kernel32" (ByVal hMem As Long) As LongPrivate Declare Function lstrlenW Lib "kernel32" (ByVal lpString As Long) As LongFunction GetCommandLineArgs() As String() Dim ptrCmdLine As Long ptrCmdLine = GetCommandLineW() Dim numArgs As Long Dim ptrArgs As Long ptrArgs = CommandLineToArgvW(ptrCmdLine, numArgs) If ptrArgs = 0 Then Exit Function Dim args() As String ReDim args(numArgs - 1) Dim i As Long, ptrArg As Long For i = 0 To numArgs - 1 CopyMemory ptrArg, ByVal ptrArgs + i * 4, 4 args(i) = LPWSTRtoStr(ptrArg) Next i LocalFree ptrArgs GetCommandLineArgs = argsEnd FunctionFunction LPWSTRtoStr(ByVal ptr As Long) As String If ptr = 0 Then Exit Function Dim length As Long length = lstrlenW(ptr) LPWSTRtoStr = String$(length, 0) CopyMemory ByVal StrPtr(LPWSTRtoStr), ByVal ptr, length * 2End FunctionSub Main() Dim cml, i cml = GetCommandLineArgs() For i = LBound(cml) To UBound(cml) MsgBox cml(i) NextEnd Sub
- Node.js
Image: https://imgur.la/image/1660-WindowsTerminal-CProgram-Filesnodejsnode.exe.iBXE7Code:
console.log(process.argv);process.stdin.setRawMode(true);process.stdin.resume();process.stdin.on('data', process.exit.bind(process, 0));
- Python
Image: https://imgur.la/image/1661-WindowsTerminal-CProgram-FilesWindowsAppsPythonSoftwareFoundation..iBlSFCode:
import sysimport msvcrtargs = sys.argvprint(args)msvcrt.getch()
- Windows Script Host
Image: https://imgur.la/image/1659-TotalCMD64-Total-Commander-%28x64%29-11.03-David-Attie.iB0evCode:
for (var i = 0; i < WScript.Arguments.length; i++) { WScript.Echo(WScript.Arguments.item(i));}
I think any program that uses the CommandLineToArgv Win32API will have this problem, because that's the Windows parsing logic.
Statistics: Posted by Mapaler — 2025-04-02, 08:27 UTC