What Are Batch Parameters


What Are Batch Parameters?

✍: FYIcenter.com


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 additional 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.


Batch Parameter Modifiers

Working with Parameters and Variables

Working with Parameters and Variables

⇑⇑ Windows Batch File Tutorials

2022-04-13, 1609🔥, 0💬