@echo off setlocal EnableExtensions EnableDelayedExpansion if "%~1"=="" goto help set "INPUT=%~1" set "EXT=%~x1" set "PATH=%PATH%;%~dp0" if /I not "%EXT%"==".pptx" ( echo [ERROR] Only .pptx supported pause exit /b 1 ) echo [INFO] Compressing %~n1 rem optional: ensure correct working dir pushd "%~dp0" "%~dp0pptx-image-compress.exe" -i "%INPUT%" set RC=%ERRORLEVEL% popd if %RC% neq 0 ( echo [ERROR] Failed (%RC%) ) else ( echo [SUCCESS] Done ) pause exit /b %RC% :help echo. echo Drag ^& Drop a .pptx file onto this script echo. pause