문제

I have this script that will display a yes-no box with a 30 second countdown, and if the user has not selected an option after the time is up, then the VBScript automatically selects the option "Yes" and returns to a Batch Script.

How do I remove the countdown part from the script, so that it will not default to "Yes", but instead wait until input is given.

Many Thanks

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 taken from http://www.msfn.org/board/topic/138818-vbscript-msgbox-with-auto-select-countdown-and-batch-script-input/

도움이 되었습니까?

해결책

This should be the answer, for more reference: 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`
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top