Question Details

No question body available.

Tags

assembly winapi cmd x86-64 command-line-arguments

Answers (1)

January 24, 2026 Score: 1 Rep: 35,313 Quality: Medium Completeness: 60%

GetCommandLine return exactly what passed to call CreateProcessW ( of course if somebody not modified internal process data or kernelbase BaseUnicodeCommandLine and/or BaseAnsiCommandLine
) that you got msl test c.exe mean only that cmd.exe pass this string to call CreateProcessW . and this is for any program. we can run notepad from cmd and started notepad will be have notepad.exe as cmd line. we can run notepad from power shell. and started notepad will be have "C:\WINDOWS\system32\notepad.exe" command line - note full path and " . so different programs can have different behaviour here. by fact you ask - why cmd.exe add extra space between executable name and it arguments. i dont know. if you ask - are exist in this some sense - answer is - no. no any sense do this, but possible. this is how cmd.exe is parsing and what decide pass as command line. if very want - possible look under debugger, what cmd.exe doing. as hint PCWSTR GetTitle(cmdnode *) return such command line. but what sense research this ? Whether this (inserting an extra space) was done intentionally or a mistake – well, it certainly wasn't intentional. It's also impossible to say it was a mistake. It's just the way it was implemented.