【发布时间】:2012-10-02 18:47:47
【问题描述】:
我有一个 VBscript 可以停止并启动一个进程。
命令行中弹出是/否问题我需要回答“是” 我怎样才能务实地做到这一点?
到目前为止我有:
Option Explicit
Dim wshShell
On Error Resume Next
Set wshShell = WScript.CreateObject("WSCript.shell")
If Err.Number <> 0 Then
Wscript.Quit
End If
wshShell.Run "cmd.exe /C cd C:\WINDOWS\system32 & process.exe STOP"
WScript.Sleep 15000
wshShell.Run "cmd.exe /C cd C:\WINDOWS\system32 & process.exe START"
On Error Goto 0
【问题讨论】:
标签: shell command-line vbscript automation shell-exec