我有一个.txt文档和一个MS Word .doc,我想发送给打印机。对于.txt文件,运行Powershell Start-Process -FilePath C:\Temp\Versions.TXT -Verb print
可以正常工作。
但是,当我使用Powershell命令Start-Process -FilePath C:\Temp\Versions.docx -Verb print
时,出现以下错误。
Start-Process : A positional parameter cannot be found that accepts argument 'version'.
At line:1 char:14
+ Start-Process <<<< -FilePath C:\Temp\Versions.docx -Verb print
+ CategoryInfo : InvalidArgument: (:) [Start-Process], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.StartProcessCommand
怎么了?有人可以帮忙吗?
最佳答案
问题不是-Verb Print
花点时间阅读错误消息:
Start-Process : A positional parameter cannot be found that accepts argument 'version'.
它说,未找到接受
version
的参数您的代码行中只有一个单词“Version”,即
Versions.TXT
请尝试以下操作:
Start-Process -FilePath "C:\Temp\Versions.TXT" -Verb print
关于powershell - Powershell打印Word文档,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16489028/