如何为Windows创建拖放GhostScript .bat文件?

我正在尝试将this script改编成适用于Windows的拖放.bat文件。脚本本身可以通过命令提示符正常运行,但是我尝试过的结果导致输出文件空白。这是我第一次制作.bat文件的尝试,以便对您的见解表示赞赏!

@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

编辑:谢谢大家,我已经根据您的建议制作了一个.bat,可以正常使用!

@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
shinhwa3200 回答:如何为Windows创建拖放GhostScript .bat文件?

@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
本文链接:https://www.f2er.com/3130377.html

大家都在问