2

If I run a Windows batch file in the following way:

myscript.bat -b test -c 789

or in the following way:

myscript.bat -c 789 -b test

What is the best way to reliably get the value of c?

Rich
  • 15,602
  • 15
  • 79
  • 126

1 Answers1

2

how about:


IF _%1==_b echo do something with %2
IF _%1==_c echo do something with %2
IF _%3==_b echo do something with %4
IF _%3==_c echo do something with %4

Joe DF
  • 5,438
  • 6
  • 41
  • 63