gpt4 book ai didi

powershell - Powershell打印Word文档

转载 作者:行者123 更新时间:2023-12-03 00:03:10 30 4
gpt4 key购买 nike

我有一个.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/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com