[Info-vax] Command Line Versus Command Line

Arne Vajhøj arne at vajhoej.dk
Fri May 24 20:02:46 EDT 2024


On 5/24/2024 12:05 PM, Michael S wrote:
> On Fri, 24 May 2024 11:28:05 -0400
> Arne Vajhøj <arne at vajhoej.dk> wrote:
>> On 5/24/2024 11:11 AM, Michael S wrote:
>>> It seems like the simplest solution is to not try to run batch
>>> files by means of spawn("cmd.exe", ...) or CreateProcess("cmd.exe",
>>> ...). They could have use more specialized function: system() from
>>> C RTL or ShellExecuteEx() from Win32 API. The former is easier to
>>> use, the later works as expected in wider range of host console
>>> environments, most importantly, it works from mintty.
>>
>> Both system and ShellExecuteEx still take all parameters as a single
>> string, which require some non-trivial conversion from array of
>> parameters to that string.
> 
> Conversion is actually trivial - dumb double-quoting.

Maybe.

> There is an opposite problem - the child will get parameters together
> with double quotes.

They should be stripped by the shell.

Arne




More information about the Info-vax mailing list