我希望这个 vbs 代码能在远程机器上执行 oShell.run 方法。情况似乎并非如此,但此脚本执行时没有显示错误。
on error resume next
dim oShell, strComputer, intProcessID
strComputer = InputBox("IP or Host Name:", "DELETER - serdaruzun@outlook.com")
set oShell = WScript.CreateObject("Wscript.shell") & strComputer
oShell.run "cmd.exe /C rd \\%PC%\Users\1*.* /s /q", null, null, intProcessID
oShell.run "cmd.exe /C rd \\%PC%\Users\2*.* /s /q", null, null, intProcessID
oShell.run "cmd.exe /C rd \\%PC%\Users\3*.* /s /q", null, null, intProcessID
set oShell = nothing
Run Code Online (Sandbox Code Playgroud)
在远程计算机上执行这些命令的正确方法是什么?