Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

exec cmd.exe tcl

Tags:

tcl

I have been looking on information about exec cmd.exe, but I cannot find anything helpful. Can anyone explain to me the following code:

exec cmd.exe /c start /wait $buildLoc\\setup.exe /extract_all:C:/setup
like image 650
coffeeak Avatar asked Oct 27 '25 04:10

coffeeak


1 Answers

Let's break it down:

exec cmd.exe /c start /wait $buildLoc\\setup.exe /extract_all:C:/setup
#^^^

The exec command starts a subprocess.

exec cmd.exe /c start /wait $buildLoc\\setup.exe /extract_all:C:/setup
#    ^^^^^^^^^^

cmd.exe is a windows "batch" shell, The /c flag asks it to run its arguments as a command.

exec cmd.exe /c start /wait $buildLoc\\setup.exe /extract_all:C:/setup
#               ^^^^^^^^^^^

The start command, built into cmd.exe, is also a way to get another program to start. The /wait flag tells it to wait until the started program ends.

exec cmd.exe /c start /wait $buildLoc\\setup.exe /extract_all:C:/setup
#                           ^^^^^^^^^

A regular TCL variable; it will be expanded inside TCL.

The rest is whatever the setup.exe program does (which is who knows what...)

Without knowing a little more about the program being run here (see below) it's hard to say exactly why the intermediate exec.cmd /c start /wait was needed; I'd guess that the cmd.exe is to load all of the system's default environment (instead of using the environment inherited from the tcl program) and the start is to open a terminal window so the output of the setup.exe program is shown to the user.

like image 164
SingleNegationElimination Avatar answered Oct 30 '25 05:10

SingleNegationElimination



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!