【发布时间】:2014-01-21 17:18:50
【问题描述】:
我正在尝试将用户输入的计算机名称传递给 psexec 命令。我什么都试过了。我知道该命令有效,因为如果我通过手动输入计算机名称来运行文件是成功的。我需要将 strComputer 变量放入 \strComputer psexec 命令中。提前致谢。
Set objShell = CreateObject("Wscript.shell")
Dim strComputer
strComputer=InputBox("Run app on remote computer",,"Type name here & click OK")
objShell.run("powershell psexec.exe -i -s \\strComputer \\domain.com\folder\app.exe domain.com")
MsgBox("Scan complete")
【问题讨论】:
-
你到底为什么要混合使用 Vbs 和 Powershell 和 Cli 工具?
-
我猜是因为我没有这方面的经验。在远程机器上执行 psexec 的最佳解决方案是什么?在添加 powershell 之前,我什至无法让 psexec 运行。
标签: powershell command-line vbscript psexec