Playing around today with a batch file and needed to work out the total number of arguments that have been passed.
[bat]
SET /A ArgCount=0
for %%a in (%*) do (
  SET /A ArgCount+=1
)
echo %ArgCount%
[/bat]
%* Represents all parameters passed to the batch file excluding %0.
