Powershell打印Word文档

时间:2013-05-10 18:55:30

标签: powershell

我有一个.txt文档和一个MS Word .doc,我想发送给打印机。运行Powershell Start-Process -FilePath C:\Temp\Versions.TXT -Verb print适用于.txt文件。

但是当我使用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

出了什么问题?有人可以提供一些帮助吗?

1 个答案:

答案 0 :(得分:1)

问题不在于-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
相关问题