메모

도스배치 start, call, wait, /b...펌

맘편한넘 2016. 8. 10. 10:11


For exe files, I suppose the differences are nearly unimportant.
 But to start an exe you don't even need CALL.

When starting another batch it's a big difference,
 as 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.

Addendum:
 Using 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>


shareimprove this answer
 

edited Jan 1 '14 at 11:54



 

answered Nov 6 '12 at 19:59


 
jeb
41.2k995116
 
 
 


4    
 
When executing a file.bat using START /WAIT you need to specify START /WAIT cmd /c "file.bat" rather than just START /WAIT "file.bat", else the cmd window created for file.bat will remain open ? FrinkTheBrave Mar 30 '15 at 7:36