diff --git a/Support/subscripts/MultiDrop.bat b/Support/subscripts/MultiDrop.bat index c5ae2cf..5b2d836 100644 --- a/Support/subscripts/MultiDrop.bat +++ b/Support/subscripts/MultiDrop.bat @@ -1,56 +1,47 @@ @echo off -setlocal +setlocal enabledelayedexpansion title ModMii MultiDrop -::chdir /d "%~dp0" pushd "%~dp0" +cd ..\.. +if not exist ModMii.exe ( + echo Error: ModMii.exe not found. + goto :exit +) +if not exist temp\MultiDrop.txt ( + echo Error: temp\MultiDrop.txt not found. + goto :exit +) + cls -cd ../.. -if not exist ModMii.exe exit -if not exist temp\MultiDrop.txt exit support\sfk echo [Red]ModMii MultiDrop echo. echo To interrupt sending dropped files to ModMii, close this window. echo. echo If you manually close ModMii but want to continue sending dropped files, enter N when asked to terminate batch job echo. -::for /f %%a in (temp\MultiDrop.txt) do (set /a TotalItems+=1) support\sfk echo [Blue]MultiDrop Queue -::Loop through the the following once for EACH line in *.txt, but respecting & ^ using !! -setlocal ENABLEDELAYEDEXPANSION set /a TotalItems=0 -for /F "tokens=*" %%A in (temp\MultiDrop.txt) do call :process "%%A" -goto:skip -:process -set command=%* -set "command=!command:^^=^!" -set "command=!command:~1,-1!" -set /a TotalItems=%TotalItems%+1 -echo %TotalItems%: "!command!" -goto:EOF -:skip -::setlocal DISABLEDELAYEDEXPANSION +for /F "usebackq delims=" %%A in ("temp\MultiDrop.txt") do ( + set "command=%%~A" + set /a TotalItems+=1 + echo !TotalItems!: "!command!" +) echo. support\sfk echo [Blue]Sending ModMii Commands -::Loop through the the following once for EACH line in *.txt, but respecting & ^ using !! -::setlocal ENABLEDELAYEDEXPANSION set /a Item=0 -for /F "tokens=*" %%A in (temp\MultiDrop.txt) do call :processMultilist "%%A" -goto:quickskip -:processMultilist -set command=%* -set "command=!command:^^=^!" -set "command=!command:~1,-1!" -set /a Item=%Item%+1 -echo %Item% of %TotalItems%: "!command!" -start /WAIT ModMii.exe "!command!" -goto:EOF -:quickskip -::setlocal DISABLEDELAYEDEXPANSION +for /F "usebackq delims=" %%A in ("temp\MultiDrop.txt") do ( + set "command=%%~A" + set /a Item+=1 + echo !Item! of !TotalItems!: "!command!" + start /WAIT ModMii.exe "!command!" +) echo. support\sfk echo [Green]Finished, press any key to exit pause>nul -exit \ No newline at end of file + +:exit +exit /b