"call" - Run Another Batch File

Q

What is the "call" batch command for?

✍: FYIcenter.com

A

The "call" command is for running another batch file, command or program.

Below is the "call" command syntax:

call command parameters

When the "call" command is executed, a child batch execution context will be created to run the given command with given parameters.

For example, the "\fyicenter\SoapUI\bin\soapui.bat" batch file can be executed directly to start SoapUI for Web API testing. But you can "call" it from your own batch file, Run-SoapUI.bat, so that you can set the work directory before the call. And remove the log file after the call.

@echo off
rem run SoapUI in my way

cd \temp
call \fyicenter\SoapUI\bin\soapui.bat > nul
del \temp\soapui.log

 

"call command" vs. "command"

List Batch Commands

Using Batch Commands

⇑⇑ Windows Batch File Tutorials

2021-04-02, 1908🔥, 0💬