Ralf,
Sure, here is my bat file (test.bat):
@echo off
(for %%a in (%*) do (
echo %%a
))
I have placed the file in 2 locations:
"C:\batTest\bat test\test.bat"
"C:\batTest\test.bat"
I am running Tcl 8.6.13 via Magic Splat in tkcon shell.
(bin) 54 % #Test1:
set batFile {C:\batTest\bat test\test.bat}
set arg1 {argNoSpaces}
set arg2 8
set command [list $batFile $arg1 $arg2]
exec {*}$command
Output:
argNoSpaces
8
(bin) 59 % #Test2:
set batFile {C:\batTest\test.bat}
set arg1 {argNoSpaces}
set arg2 8
set command [list $batFile $arg1 $arg2]
exec {*}$command
Output:
argNoSpaces
8
(bin) 64 % #Test3:
set batFile {C:\batTest\test.bat}
set arg1 {arg with spaces}
set arg2 8
set command [list $batFile $arg1 $arg2]
exec {*}$command
Output:
"arg with spaces"
8
#Test4:
set batFile {C:\batTest\bat test\test.bat}
set arg1 {arg with spaces}
set arg2 8
set command [list $batFile $arg1 $arg2]
exec {*}$command
Output:
'C:\batTest\bat' is not recognized as an internal or external command,
operable program or batch file.
(bin) 89 % #Test5:
set batFile {C:\batTest\bat test\test.bat}
set arg1 {argNoSpace}
set arg2 {arg with spaces}
set command [list $batFile $arg1 $arg2]
exec {*}$command
Output:
'C:\batTest\bat' is not recognized as an internal or external command,