@echo off
title pcutmp3
cd /d "F:\pcutmp3"
:again
if "%~1" == "" goto done
java -jar pcutmp3.jar --cue "%~1" --dir "F:\Test"
shift
goto again
:done
pause
exit
This is your basic “Eat all the arguments” loop. The important part is the shift
keyword, which eats %1
, and shifts all the arguments down by one (so that %2
becomes %1
, %3
becomes %2
, etc)
So, if you run it like so:
pcutmp3.bat a b c
It will call java like so:
java -jar pcutmp3.jar --cue "a" --dir "F:\Test"
java -jar pcutmp3.jar --cue "b" --dir "F:\Test"
java -jar pcutmp3.jar --cue "c" --dir "F:\Test"