Search code examples
command-linebatch-filecmd

How do I run a batch script from within a batch script?


How do I call another batch script from within a batch script?

I want it to execute in an if statement.


Solution

  • Use CALL as in

    CALL nameOfOtherFile.bat
    

    This will block (pause) the execution of the current batch file, and it will wait until the CALLed one completes.

    If you don't want it to block, use START instead.

    Get the nitty-gritty details by using CALL /? or START /? from the cmd prompt.