application1 starts another application2 with two parameters, for example: (NOTE: application1 is not my program)
application2.exe -d:C:\Program Files\app folder -z:Folder menu\app icons
The problem is that ... the quotes somehow disappeared, so instead of 2 parameters application2 will get 5 parameters
Param1=-d:C:\Program
Param2=Files\app
Param3=folder
Param4=-z:Folder menu\app
Param5=app icons
Is there a way to get all the parameters as a single line?
I tried combining parameters in a loop
for i:=1 to ParamCount do
parameters=parameters+' '+ParamStr(i);
but this is not a good solution, because the path may also contain double or triple spaces for example.
Program files\app folder\
cmd.exe can capture all parameters in% *, but gives incorrect results if the parameter contains special characters, such as ^^ ~ @@ & & & ...
source
share