Several ways to call a windows batch file from another one or from prompt. Which one in which case?

Posted by dim on Stack Overflow See other posts from Stack Overflow or by dim
Published on 2010-04-09T13:35:32Z Indexed on 2010/04/09 14:13 UTC
Read the original article Hit count: 132

Filed under:
|
|

A windows batch file (called.bat or called.cmd) can be called from another batch file (caller.bat or caller.cmd) or interactive cmd.exe prompt in several ways:

  1. direct call: called.bat
  2. using call command: call called.bat
  3. using cmd command: cmd /c called.bat
  4. using start command: start called.bat

I'm quite in trouble to differentiate their intended usage based on their help text: when to use which one? e.g. why I might use 'call' command instead of direct call. What's different?

I'm interested on some summary report that analyze all 4 possibilities (and others if any missing) from various point of views: recommended use cases for which they are designed to fit, process spawning, execution context, environment, return code processing.

Note: I'm using Windows XP SP3.

© Stack Overflow or respective owner

Related posts about Windows

Related posts about batch