【问题标题】:Print using Foxit in PowerShell在 PowerShell 中使用 Foxit 进行打印
【发布时间】:2017-07-11 06:10:40
【问题描述】:

我正在尝试使用 PowerShell 脚本将多个文档打印到默认打印机。关于我可以做些什么来让它发挥作用的任何想法?

$files = Get-ChildItem -Filter "*.pdf"
foreach ($file in $files) {
    "c:\Program Files (x86)\Foxit Software\Foxit Reader\FoxitReader.exe" /t $file
}

【问题讨论】:

  • 如果 foxit 阅读器与 .pdf 文件相关联 Start-Process -FilePath $file –Verb Print 应该这样做
  • 是的,但是在没有活动用户登录的情况下在脚本中运行时它不起作用。我的最终目标是运行脚本来打印文件。

标签: powershell pdf printing foxit


【解决方案1】:

使用参数/p 打印到默认打印机,使用call operator (&) 执行带引号的命令路径。

改变这一行:

"c:\Program Files (x86)\Foxit Software\Foxit Reader\FoxitReader.exe" /t $file

进入这个:

& "c:\Program Files (x86)\Foxit Software\Foxit Reader\FoxitReader.exe" /p $file

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-01-27
    • 1970-01-01
    • 2016-08-16
    • 2012-01-26
    • 1970-01-01
    • 2013-03-25
    相关资源
    最近更新 更多