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,373
  • 15
  • 76
  • 124

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,157
  • 6
  • 38
  • 61