Vbscript / User Interaction / Select Option Popup Dialogue
Use the Shell Popup method to get user input in a variety of ways. The input options are listed below:
Icons = Constant Name - Constant Value STOP = vbCritical - 16 QUESTION MARK = vbQuestion - 32 EXCLAMATION MARK = vbExclamation - 48 INFORMATION = vbInformation - 64
Buttons = Constant Name - Constant Value OK = vbOKOnly - 0 OK and CANCEL = vbOKCancel - 1 ABORT, RETRY and IGNORE = vbAbortRetryIgnore - 2 YES, NO and CANCEL = vbYesNoCancel - 3 YES and NO = vbYesNo - 4 RETRY and CANCEL = vbRetryCancel - 5
Set objShell = WScript.CreateObject("WScript.Shell")
Timeout = 5
var = "Yes"
Msg = "Choose an option to continue. If you do not choose in " & Timeout & " seconds, the default option of " & var & " will be used" Title = "Select Option"
iRetVal = objShell.Popup(Msg,Timeout,Title,vbYesNo + vbQuestion)
Select Case iRetVal
Case vbYes var = "Yes"
Case vbNo
var = "No"
Case -1
Wscript.Echo "Time out!" End Select
Wscript.Echo "You chose " & var
Please note that a disclaimer applies to any code on this page.
|