I'm trying to adapt this script into a drag and drop .bat
file for Windows. The script itself works perfectly fine through the Command Prompt, but what I've tried has resulted in a blank output file. This is my first attempt at making a .bat
file so any insight is appreciated!
@echo off
cd C:\Program Files\gs\gs9.26\bin
gswin64c.exe -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile="%~1"_sm.pdf "%~1".pdf
pause
exit
EDIT: Thanks guys, I've used your suggestions to make a .bat
that works as intended!
@echo off
"C:\Program Files\gs\gs9.26\bin\gswin64c.exe" -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile="%~dp1%~n1_sm.pdf" "%~1"
pause
exit