【发布时间】:2014-08-20 18:03:59
【问题描述】:
我正在尝试使用 wshShell.Exec 或 wshShell.Run 通过另一个脚本运行脚本。这两种方法我都试过了,两种方法都给我同样的错误。我已经用谷歌搜索了这个问题,但找不到任何似乎可以解决这个问题的东西。唯一真正相关的建议是尝试使用 wshShell.Run 而不是 Exec。
这是我脚本的相关部分:
strScriptPath = "T:\IT resources\Scripts\Shutdown Scripts"
strForceShutdown = "ForceShutdown.vbs"
For j = 0 to 99
Set objActive = wshShell.Run(strForceShutdown)
' In case I ever need to get this working to run it from another folder.
' Set objActive = wshShell.Exec("cd " & strScriptPath & "")
' Set objActive = wshShell.Exec("wscript " & strForceShutdown & "")
constConf = MsgBox("Automatic shutdown initializing. Continue?" & chr(10) & "Y=Shutdown N=Postpone 30 minutes",4,"Automatic Shutdown Notification")
If constConf = 7 Then
objActive.Terminate
Wscript.Sleep(1800000)
Else
objActive.Terminate
Exit For
End If
Next
感谢您的帮助!
【问题讨论】: