Passing command-line argument into a DOS (including Windows) batch file

You can use these variables in a batch file:
%0 – the batch file’s name
%1 – the 1st argument
%2 – the 2nd argument
%3 – the 3rd argument

%9 – the 9th argument

e.g. Support the content of test.bat is as follows:

@echo off
echo param0: %0
echo param1: %1
echo param2: %2
echo param3: %3
echo param4: %4

Then “test a b” gives:

param0: test
param1: a
param2: b