dancavallaro has it right, %*
for all command line parameters (excluding the script name itself). You might also find these useful:
%0
- the command used to call the batch file (could be foo
, ..foo
, c:atsfoo.bat
, etc.)
%1
is the first command line parameter,
%2
is the second command line parameter,
and so on till %9
(and SHIFT
can be used for those after the 9th).
%~nx0
- the actual name of the batch file, regardless of calling method (some-batch.bat)
%~dp0
- drive and path to the script (d:scripts)
%~dpnx0
- is the fully qualified path name of the script (d:scriptssome-batch.bat)
More info examples at https://www.ss64.com/nt/syntax-args.html and https://www.robvanderwoude.com/parameters.html
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…