Original Script, I get this error message with it.
Error Message
Microsoft VBScript compilation error: Expected end of statement
'**********************************************************
'* Displaying Message-boxes.
'**********************************************************
'* Easiest, but least options (only [OK]-button)
WScript.Echo "This is my computer: " & strComputer & "."
'
'* Wscript.Shell Popup-method has many options
'* A timed message-box (5 sec.)
Const TIMEOUT = 5
Set objShell = WScript.CreateObject("WScript.Shell")
objShell.Popup "Disk Report Complete", TIMEOUT
'* Constants for Icons
'** Icon_______________Constant Name___Constant Value
'** STOP vbCritical 16
'** QUESTION MARK vbQuestion 32
'** EXCLAMATION MARK vbExclamation 48
'** INFORMATION vbInformation 64
Const vbCritical = 16
'* Constants for Button Sets
'** Button Set_____________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
Const vbYesNo = 4
'* Constants for Default Button Locations
'** Default Button_Constant Name_______Constant Value
'** LEFT vbDefaultButton1 0
'** MIDDLE vbDefaultButton2 256
'** RIGHT vbDefaultButton3 512
Const vbDefaultButton3 = 512
'* Display both an icon and a button set, timeout is 10 sec., default is
'* rightmost button (No).
TIMEOUT = 10
strPopupTitle = "Popup Example"
strPopupText = "Stop Icon / Abort, Retry and Ignore Buttons"
objShell.Popup strPopupText, TIMEOUT, strPopupTitle, vbCritical + vbYesNo + vbDefaultButton3
'* Retrieving User Input
'* Button Constants
'** Value__Constant____Button Clicked
'** 1 VbOK OK
'** 2 VbCancel Cancel
'** 3 VbAbort Abort
'** 4 VbRetry Retry
'** 5 VbIgnore Ignore
'** 6 VbYes Yes
'** 7 VbNo No
Const VbYes = 6
intClicked = objShell.Popup strPopupText, TIMEOUT, strPopupTitle, vbCritical + vbYesNo + vbDefaultButton3
'** This can be verified with either of the following lines:
If intClicked = 6
'** or
If intClicked = VbYes
'** or (more elaborate, but also more options):
Select Case intClicked
Case vbYes
WScript.Echo "Yes"
Wscript.Quit
Case vbNo
WScript.Echo "No"
Wscript.Quit
Case -1
WScript.Echo "Popup timed out."
Wscript.Quit
End Select