How can I output all of a batch file's arguments?

A. Although you can typically output only nine parameters from a batch file, you can use a percent symbol (%) followed by an asterisk (*) to output all parameters for all arguments passed into a batch file. For example, if I run test.bat

@rem test.bat
@echo off
echo %*

by typing

C:\>test a b c d e f g h i j k l m n o p

the batch file will display the following output onscreen:

a b c d e f g h i j k l m n o p
Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.