What Are Batch Parameters

Q

What Are Batch Parameters?

✍: FYIcenter.com

A

Batch parameters are parameters received from the command line where the batch file is invoked.

There are total of 11 batch parameters supported a batch file using the "%n" format:

  • %0 - The file name of this batch file.
  • %1, %2, %3, ..., %9 - The first, second, third, ..., ninth parameters provided when this batch file was invoked.
  • %* - All parameters in a single string.

If you call a batch file with more than 9 parameters, the tenth and addtional parameters will not be represented in the "%n" format initially.

To access the tenth and additional parameters, you need to use the "shift" command to shift them into the 1 to 9 range.

 

Working with Parameters and Variables

⇒⇒Windows Batch File Tutorials

2017-12-05, 108👍, 0💬