The below commands use the printer named "JD-268BT" (which is a label printer I have), change it as needed.
Use Ghostscript to print a PDF from Powershell: Copy to Clipboard
Start-Process "C:\Program Files\gs\gs10.06.0\bin\gswin64c.exe" -ArgumentList " -dPrinted -dNoCancel -dBATCH -dNOPAUSE -dNOSAFER -sDEVICE=mswinpr2 -sOutputFile=`"%printer%JD-268BT`" `"C:\Users\Admin\Desktop\ThePDF.pdf`""
From a batch file: Copy to Clipboard
Start-Process "C:\Program Files\gs\gs10.06.0\bin\gswin64c.exe" -dPrinted -dNoCancel -dBATCH -dNOPAUSE -dNOSAFER -sDEVICE=mswinpr2 -sOutputFile="%printer%JD-268BT" "C:\Users\Admin\Desktop\LastFile.pdf"
|