Skip to content

Instantly share code, notes, and snippets.

@Zeinok
Created May 27, 2017 12:30
Show Gist options
  • Save Zeinok/7c91cb1b58473e7d2160cf5f933d8dbf to your computer and use it in GitHub Desktop.
Save Zeinok/7c91cb1b58473e7d2160cf5f933d8dbf to your computer and use it in GitHub Desktop.
ffprompt.cmd

ffprompt for ffmpeg win32

why ff-prompt.bat is missing in newer win32 ffmpeg build

Publish with MIT License

@echo off
::Publish with MIT License
if NOT "%~1"=="__CMDSTARTED__" cmd.exe /q /k %0 __CMDSTARTED__
if NOT "%~1"=="__CMDSTARTED__" exit /b
echo.
set ffpath=%~dp0\bin
pushd %ffpath%
if %errorlevel% NEQ 0 call :err %errorlevel%
if %errorlevel% EQU 1 echo Can't find bin folder, quitting... & pause & exit /b 1
set ffpath=%cd%
popd
set PATH=%PATH%;%ffpath%
echo Done setting PATH, executing "ffmpeg -version".
echo.
ffmpeg -version
if %errorlevel% NEQ 0 call :err %errorlevel%
if %errorlevel% EQU 9009 echo FFmpeg is not found in bin folder, quitting.. & pause & exit /b 1
echo.
echo =====FFprompt=====
echo FFmpeg bin path is: %ffpath%
echo Current working directory is: %CD%
echo Type exit if you no longer want to use PATH with FFmpeg.
echo.
goto :EOF
:err
echo Errorlevel: %~1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment