0

Trying to convert some mp3 to ogg using VLC on Win7.

I started by modifying what I found here, but couldn't get it to work: How to convert several files of one type (e.g. wav to mp3) using VLC or Audacity at a single blow?

So the script I have currently:

@echo off
for /f "delims=|" %%f in (dir /b "C:\Program Files (x86)\VideoLAN\VLC\VLC_batch\*.mp3") do (
echo %%f
CALL "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" "%%f" --sout=#transcode{acodec=vorb,ab=192,vcodec=dummy}:standard{access=file,mux=raw,dst=converted/%%f}  vlc://quit
move "%%f" trash/"%%f"
)

cd converted
ren *.mp3 *.ogg
cd ..
pause

The error is:

The system cannot find the file dir
The system cannot find the file specified

I put the music files to convert in the C:\Program Files (x86)\VideoLAN\VLC\VLC_batch directory, and I have "trash" and "converted" both in the batch directory and in the VLC directory.

3

You need to put a single quote around your command...

for /f "delims=|" %%f in (dir /b...

becomes

for /f "delims=|" %%f in ('dir /b...

Though with the double-quote you use later to call VLC, I'm betting you need to start out with double quotes and include the C:\Program... part in single quotes. Give that a try.

  • Agreed. The first error is because the dir command was not encapsulated. The second error is because the rename operation failed since there is no converted file – Yorik Mar 18 '15 at 21:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.