Friday, December 14, 2012

Passing unknown number of parameters to a program through a batch file

My system has a process which calls other programs, and the program to be executed and its parameters, whose number varies, is all database driven.  So how do I say "pass whatever parameters you got to the program"?  Answer: %* (percent-asterisk) means ALL parameters.  So I make sure the first parameter is the name of the program to be called, followed by all other parameters.  Nice trick.

No comments:

Post a Comment