rem @echo off setlocal EnableExtensions EnableDelayedExpansion rem Adjust these to your install directories set VLC=c:\util\vlc\vlc.exe rem set OUTDIR=%USERPROFILE%\Videos\Zune set OUTDIR=c:\temp rem Default to *.avi set MASK=%1 if x%1x==xx set MASK=*.avi rem Make the output directory if it's not already there if not exist %OUTDIR% md %OUTDIR% for %%F in (%MASK%) do ( set targ=%%~nF set targ=!targ:,=! set targ=!targ:'=! echo Encoding %%F to %OUTDIR%\!targ!.mp4 start "Running VLC" /low /wait /min "%VLC%" "%%F" --intf=dummy --sout-x264-level=13 --sout-x264-bframes=0 --no-sout-x264-cabac --sout-x264-qp=0 --no-sout-x264-8x8dct --sout=#transcode{width=320,vcodec=h264,vb=768,acodec=mp4a,ab=128,channels=2,threads=%NUMBER_OF_PROCESSORS%}:standard{mux=mp4,dst="%OUTDIR%\!targ!.mp4",access=file} vlc:quit ) endlocal