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
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Let’s break it down:
The exec command starts a subprocess.
cmd.exe is a windows “batch” shell, The
/cflag asks it to run its arguments as a command.The start command, built into
cmd.exe, is also a way to get another program to start. The/waitflag tells it to wait until the started program ends.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 /waitwas 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 thestartis to open a terminal window so the output of the setup.exe program is shown to the user.