Posted By: Anonymous
How is the START command with a WAIT option
START /wait notepad.exe START /wait notepad.exe
…any different from using a CALL command?
CALL notepad.exe CALL notepad.exe
Is there a situation where one may behave differently that the other dependending on what is being executed?
For exe files, I suppose the differences are nearly unimportant.
But to start an exe you don’t even need
When starting another batch it’s a big difference,
CALL will start it in the same window and the called batch has access to the same variable context.
So it can also change variables which affects the caller.
START will create a new cmd.exe for the called batch and without /b it will open a new window.
As it’s a new context, variables can’t be shared.
start /wait <prog>
– Changes of environment variables are lost when the
– The caller waits until the
<prog> is finished
– For exe it can be ommited, because it’s equal to just starting
– For an exe-prog the caller batch waits or starts the exe asynchronous, but the behaviour depends on the exe itself.
– For batch files, the caller batch continues, when the called
<batch-file> finishes, WITHOUT call the control will not return to the caller batch
CALL can change the parameters (for batch and exe files), but only when they contain carets or percent signs.
call myProg param1 param^^2 "param^3" %%path%%
Will be expanded to (from within an batch file)
myProg param1 param2 param^^3 <content of path>