2

我有这个脚本,它将显示一个带有 30 秒倒计时的是-否框,如果用户在时间结束后没有选择选项,那么 VBScript 会自动选择选项“是”并返回到批处理脚本。

如何从脚本中删除倒计时部分,使其不会默认为"Yes",而是等到输入给出。

非常感谢

Option Explicit
Dim oShell, retCode
Set oShell = WScript.CreateObject("WScript.Shell")

retCode = oShell.Popup("Place your question here?", 30, "Title", 4 + 32)

Select Case retCode
case 6, -1
    WScript.quit(0) 'Yes or time-out was chosen
case 7
    WScript.quit(1) 'No was chosen
End Select

vbscript 取自http://www.msfn.org/board/topic/138818-vbscript-msgbox-with-auto-select-countdown-and-batch-script-input/

4

1 回答 1

1

这应该是答案,更多参考: WScript.Shell.Popup

Dim oShell, retCode
Set oShell = WScript.CreateObject("WScript.Shell")

retCode = oShell.Popup("Place your question here?", 0, "Title", 4 + 32)

Select Case retCode
case 6, -1
WScript.quit(0) 'Yes or time-out was chosen
case 7
WScript.quit(1) 'No was chosen
End Select`
于 2012-12-19T01:08:15.753 回答