
I'm making a new batch file to convert any *.mp4 files to *.mp3 files with VLC in command line, but i want to improve it to choose the Input folder on Videos for any windows system !
So, i wonder How to get on videos folder with command line ?

Thank you !
Here is my code : MP4-MP3_Converter.bat
Code: Select all
@echo off
Title Convert (*.mp4) to (*.mp3) with VLC by (c) Hackoo 2017
mode con:cols=85 lines=5 & COLOR 0E
Taskkill /IM "vlc.exe" /F >nul 2>&1
echo.
set "VLC_URL=http://www.videolan.org/vlc/download-windows.html"
IF /I "%PROCESSOR_ARCHITECTURE%"=="x86" (
Set "vlc=%ProgramFiles%\VideoLAN\VLC\vlc.exe"
) else (
Set "vlc=%ProgramFiles(x86)%\VideoLAN\VLC\vlc.exe"
)
If Not Exist "%vlc%" (
Cls & COLOR 0C
echo.
Echo "The VLC program is not installed on your system"
TimeOut /T 5 /NoBreak>nul
Start "" %VLC_URL%
Exit
)
Set "MP4Folder=C:\MP4Folder"
Set "MP3Folder=C:\MP3Folder"
If not exist "%MP3Folder%" MD "%MP3Folder%"
CD /D "%MP4Folder%"
for %%a in (*.mp4) do (
Cls
echo(
echo Please wait a while ... The Conversion is in progress ...
echo Conversion of "%%~na.mp4" to "%%~na.mp3"
"%vlc%" -I dummy "%%a" --sout=#transcode{acodec=mp3,ab=128,vcodec=dummy}:std{access="file",mux="raw",dst="%MP3Folder%\%%~na.mp3"} vlc://quit
)
Explorer "%MP3Folder%" & Exit