Printing PDFs from Windows Command Line

后端 未结 11 500
我寻月下人不归
我寻月下人不归 2020-11-30 01:06

I\'m trying to print all pdfs in current dir. When I call this bash script in cmd (singlepdf.sh): \'\"C:\\Program Files (x86)\\Adobe\\Reader 10.0\\Reader

11条回答
  •  春和景丽
    2020-11-30 01:53

    The error message is telling you.

    Try just

    "C:\Program Files (x86)\Adobe\Reader 10.0\Reader\AcroRd32.exe" /t "$pdf"
    

    When you enclose the string in single-quotes, this makes everything inside a valid string, including the " chars. By removing the single-quotes, the shell will process the dbl-quotes as string "wrappers".

    I would also wrap the filename variable in dbl-quotes so you can easily process files with spaces in their names, i.e.

    "C:\Program Files (x86)\Adobe\Reader 10.0\Reader\AcroRd32.exe" /t "$pdf"
    

    IHTH

提交回复
热议问题