PDA

View Full Version : I wrote a batch to process multiple files and it won't pause at the end.


jonathonsunshine
9th October 2006, 16:23
Greetings

I have written a batch that prepares mpg or ts or vob files for gordian knot

i drag and drop a bunch of say 10 .mpg onto this batch file and it will

create a .D2V file with dgindex

then it will encode the MPEG audio or AC3 audio into mp3

then it will use mp3gain to normalize the mp3 to 89db

it will do this for all of the files.

it works perfect

EXCEPT

it won't bloody pause at the end so i can go back and check for anything having gone wrong.

What i want to know is how can i make this batch file pause at the end

----------------------------------


echo off

cls

:LOOP

F:\XVIDStuff\Programs\DGIndex\dgindex.exe -IF=[%~1] -IA=6 -YR=1 -OM=2 -AT=[] -OF=[%~dpn1] -EXIT -HIDE

IF NOT EXIST "%~dpn1* 0ms.mpa" GOTO DOLBYDIGITAL

ren "%~dpn1* 0ms.mpa" "%~n1.mpa"

f:\AUDIOCONVERTER\BeSweet.exe -core( -input "%~dpn1.mpa" -output "%~dpn1.wav" -2ch ) -azid( -s dplii -d 3/2 -c normal ) -ota( -d auto )

del "%~dpn1.mpa"

f:\AUDIOCONVERTER\lame\lame.exe --noreplaygain -q 0 -h -V 4 -b 112 -B 320 "%~dpn1.wav" "%~dpn1.mp3"

del "%~dpn1.wav"

f:\AUDIOCONVERTER\mp3gain.exe /c /r /t "%~dpn1.mp3"

GOTO FINISHED

:DOLBYDIGITAL

IF NOT EXIST "%~dpn1* 0ms.ac3" GOTO FINISHED

ren "%~dpn1* 0ms.ac3" "%~n1.ac3"

f:\AUDIOCONVERTER\BeSweet.exe -core( -input "%~dpn1.ac3" -output "%~dpn1.wav" -2ch ) -azid( -s dplii -d 3/2 -c normal ) -ota( -d auto )

del "%~dpn1.ac3"

f:\AUDIOCONVERTER\lame\lame.exe --noreplaygain -q 0 -h -V 4 -b 112 -B 320 "%~dpn1.wav" "%~dpn1.mp3"

del "%~dpn1.wav"

f:\AUDIOCONVERTER\mp3gain.exe /c /r /t "%~dpn1.mp3"

:FINISHED

shift

IF NOT %1 == "" GOTO LOOP

pause

mod
9th October 2006, 16:58
Here it is:

PING 1.1.1.1 -n 1 -w 2000 >NUL

Pauses for 2000 ms.

Mug Funky
12th October 2006, 05:08
IF NOT %1 == "" GOTO LOOP

try replace with

IF NOT "%~1" == "" GOTO LOOP

i'm clutching at straws though...

possibly the batch is exiting due to a bad command somewhere else in it?

pc_speak
16th October 2006, 02:51
After cls at the start try echo %1 %2 %3 %4 etc to see if the batch file is picking up some extra chatacter(s) when you drag & drop. I think there is also a buffer limit when you drag & drop to a .cmd batch file. 10 long file names might be corrupting the buffer. I do something similar here. (http://www.users.on.net/~pcspeak/) No drag & drop though. ;)