Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unknow number of parameters for batch file

Status
Not open for further replies.

Michaeljc70

Programmer
Mar 16, 2012
5
US
I need to write a batch file that can be passed one to many parameters. I need to call another program with those parameters, plus one other possibly (based on some other logic) and than add on the last parameter (which is a filename really).

For example:
The batch file is called with -i:abc -x:pqr -l:hjk filename.txt

I need to grab the first 3 params, add 1 more and then add the last:
-i:abc -x:pqr -l:hjk -p:xxxx filename.txt

Any ideas on how to most easily do this?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top