Log in

View Full Version : CLI problem: DGindex doesn't take spaces in a filename


Mug Funky
29th May 2005, 12:46
hi all. i'm kinda lazy, so i decided to make a batch to create a d2v file and an avs file for any m2v or vob file dragged onto it.

my problem is that if there's a space in the filename being passed, DGindex doesn't accept the input, and my batch stops in its tracks.

i'm pretty new at win2k/XP batching, but here's my attempt so y'all can try to replicate it.

IF NOT EXIST %1 EXIT

"C:\MediaTools\AviSynth 2.5\plugins\dgMPEG\DGIndex.exe" -OM=0 -IF=[%1] -OF=[%~d1%~p1%~n1] -exit

echo # Auto-generated avs script by Sal. > "%~d1%~p1%~n1.avs"
echo.
echo mpeg2source("%~d1%~p1%~n1.d2v") >> "%~d1%~p1%~n1.avs"

there's a couple of other echos in there, but only for filters and stuff (which is irrelevant to this problem).

is this something that can be fixed in my batch, or does it need a (presumably minor) change made to DGindex? i'm using the latest one (1.3.1 beta 6)

buzzqw
29th May 2005, 14:01
hi :)


FOR /F "tokens=*" %%i in (C:\MediaTools\"AviSynth 2.5"\plugins\dgMPEG\DGIndex.exe -OM=0 -IF=[%1] -OF=[%~d1%~p1%~n1] -exit) DO CALL START %%i

would fuction

BHH

P.S. The problem in within the space, remember that dos isn't so friendly.. :rolleyes:

P.P.S Feel free to post all the batch, could be useful for other too :)

Mug Funky
29th May 2005, 14:10
that line doesn't seem to do anything but exit the batch (even after remming out the first line with the exit command).

on top of that i can't make sense of it :(

[edit]

btw, i should mention that everything works fine if there's no spaces in the filename. for example, "my stupid file.m2v" doesn't work, but "my_stupid_file.m2v" does. that says to me that there's nothing wrong with my batch, but i'm pretty novice, so i'm not going to assume that right away.

[edit 2]

w00t! replaced %1 with %~1 and it worked - DGindex didn't like the quotes that i didn't realise %1 was putting inside the square brackets.

thanks for your help though.