03-26-2018, 08:33 PM
Code:
@ECHO OFF
TITLE Compress GIMP
CLS
REM This is to get the first argument after the batch file
SET FILE_IN=%1
CALL :DEQUOTE FILE_IN
REM This sets the path used in the gimp script
SET PATH=%FILE_IN%\*.png
REM This prints the path
ECHO Will run GIMP script in path '%PATH%'. Press Enter to continue or Ctrl+C to exit.
REM This waits for enter input
PAUSE
REM Change argument 0 to the GIMP exe
REM For me it's "D:\Programs\GIMP 2\bin\gimp-2.8.exe"
REM If you want to run it inside the current cmd window,
REM use gimp-console-2.8.exe, otherwise (aka new window pops up), use gimp-2.8.exe
"D:\Programs\GIMP 2\bin\gimp-2.8.exe" -i -b "(batch-auto-fix \"%PATH%\")"
REM Tell user it's done!
ECHO DONE.
GOTO:EOF
:DEQUOTE
FOR /F "delims=" %%A IN ('echo %%%1%%') DO SET %1=%%~A
GOTO:EOF