Just converting some shell scripts into batch files and there is one thing I can\'t seem to find...and that is a simple count of the number of command line arguments.
Try this:
SET /A ARGS_COUNT=0 FOR %%A in (%*) DO SET /A ARGS_COUNT+=1 ECHO %ARGS_COUNT%