DESCRIPTION
A very easy way to add a timeout in a message box (msgbox) in a VBS (WSH Windows Scripting Host) file.
Option Explicit
Dim oShell
Dim iResult
' Create Shell object
Set oShell = CreateObject("Wscript.Shell")
'Open message box Yes/No and test response
iResult = oShell.Popup("This message box will close after 2 seconds.", 2, "Title box", 4)
'Test the return of messagebox
If iResult = 6 Then
Wscript.Echo "YES"
ElseIf iResult = 7 Then
Wscript.Echo "NO"
Else
Wscript.Echo "NO RESPONSE"
End If
MSDN : http://msdn.microsoft.com/en-us/library/x83z1d9f(VS.85).aspx