我正在尝试将用户输入计算机名称传递给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")
1 回答
为什么不使用PowerShell脚本呢?