【问题标题】:Unable to DOS commands using Power shell on Windows 10无法在 Windows 10 上使用 Powershell 执行 DOS 命令
【发布时间】:2018-02-23 16:17:42
【问题描述】:

在我的流程文档中,我从命令提示符运行下面提到的命令,它在命令提示符下运行良好,但是当我从 Power Shell 运行这些命令时它不起作用。

c:\temp\sig.csv sig.csv 有输入文件。 我希望这个命令静默执行,它从临时文件夹中的 sig.csv 文件中获取输入。

以下是我正在关注但使用 powershell 的链接。

https://www.paloaltonetworks.com/documentation/40/endpoint/endpoint-admin-guide/manage-traps-in-a-vdi-environment/configure-the-master-policy/traps-vdi-tool-cli.html

Dos 命令:

TrapsVdiTool -i:c:\temp\sig.csv -e:192.168.70.100 -ssl -to:1

我使用 cmd.exe 运行它也尝试使用 & 执行它

& TrapsVdiTool -i:c:\temp\sig.csv -e:192.168.70.100 -ssl -to:1
cmd.exe /c "TrapsVdiTool -i:c:\temp\sig.csv -e:192.168.70.100 -ssl -to:1"

【问题讨论】:

  • “不起作用”是什么意思?错误?
  • 我遇到了错误。命令行参数 -i:C:\temp\sig.csv' 的格式无效。中止。
  • 有谁能帮助我吗?出现以下错误“命令行参数格式无效 -i:C:\temp\sig.csv'。中止”
  • 有人可以帮忙吗?

标签: powershell-2.0 powershell-3.0


【解决方案1】:

在 Powershell 控制台中它应该这样运行:

& TrapsVdiTool '-i:c:\temp\sig.csv' '-e:192.168.70.100' '-ssl' '-to:1'

Powershell: Running Executables

【讨论】:

    猜你喜欢
    • 2018-01-04
    • 2012-04-28
    • 1970-01-01
    • 2022-09-26
    • 2017-03-29
    • 1970-01-01
    • 1970-01-01
    • 2022-01-17
    • 2014-01-14
    相关资源
    最近更新 更多