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

A. Simply entering a batch file’s name within another batch file will run the batch file you want to call. However, after the called batch file completes, it won’t pass control back to the calling batch file. Thus, the calling batch file will be incomplete. To call a batch file and have the file return to the calling batch file after the called file completes, use the call command.

John Savill

January 8, 2000

1 Min Read
ITPro Today logo in a gray background | ITPro Today

A. Simply entering a batch file’s name within another batch file will run the batch file you want to call. However, after the called batch file completes, it won’t pass control back to the calling batch file. Thus, the calling batch file will be incomplete. To call a batch file and have the file return to the calling batch file after the called file completes, use the call command.

Also, learn how to write a long command in a batch file.

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like