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

John Savill

June 2, 2003

1 Min Read
ITPro Today logo in a gray background | ITPro Today

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 offecho %*

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

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like