2013-10-31 92 views
1

試圖尋找答案,都是太簡單,或不符合我的需要。我有一個消息框,並且它正確顯示了信息。我有一個是和否按鈕。我想要一個定時器,所以當定時器耗盡時,它會繼續。如果有人點擊是,它會繼續執行代碼,如果他們沒有打開,那麼它會將用戶返回到別處。這是我的,請幫助。VBSCRIPT MsgBox VbYesNo倒計時

akey = MsgBox ("Image OS = " & ImageType & vbcrlf & _ 
    "ComputerName = " & ComputerName & vbcrlf & _ 
    "TimeZone = " & TZone & vbcrlf & _ 
    "Ghost Server = " & Server & vbcrlf & _ 
    "Broadcast Method = " & BMethod & vbcrlf & _ 
    "Ghost Session = " & GhostSession _ 
    , vbyesno + vbquestion,VN & " Please Confirm") 
+0

MessageBox是一個特殊用途(非常簡單)的彈出窗口。如果您需要更有趣的東西,那麼您需要創建一個超出vbscript界限的對話框。 –

+0

可能的重複[有沒有辦法讓一個MessageBox在設定的時間間隔後自動關閉?](http://stackoverflow.com/questions/10252237/is-there-a-way-to-get-a -messagebox-to-automatically-dismiss-after-a-set-interval) – Helen

回答

3

您可以使用彈出式的,而不是MSGBOX ...

http://ss64.com/vb/popup.html

Set objShell = CreateObject("WScript.Shell") 

X = objShell.Popup("You have 3 Seconds to answer", 3, "Test", vbYesNo) 

Select Case X 
Case vbYes 
    Msgbox "You pressed YES" 
Case vbNo 
    Msgbox "You pressed NO" 
Case Else 
    MsgBox "You pressed NOTHING" 
End Select 

否則,你就可以嘗試操縱一個HTA或Internet Explorer窗口做同樣的事情。

+0

謝謝。只是我需要什麼。修改爲匹配我的腳本。 – grant117