.BAT Switches Parsing
- by giiYanJ
Erm.. I'm working with a switches parsing in BAT files, which goes like this:
<commands> -a -b -x -y -z -u abc ......
The user may input a lot of switch, or none. So I used looped shift to make parsing infinite switches possible:
:loop
IF "%1"=="-a"
...
SHIFT
GOTO loop
But when the script ends, I always get cmd executing the switches…