/build/static/layout/Breadcrumb_cap_w.png

VBScript If statement for Exit Code

So I'm sure I've used this logic before and never had a problem.  Below is the part of my script which is causing me problems.  So the EV install bombs out with a 1603 code, confirmed in the message box, the script then goes on and shows the "successful" message box.  It should in theory skip this and quit after the Else statement.  Am I missing something really obvious here?  Why is the If Statement returning True when x = 1603?

Dim strVersion, i, x
Set WshShell = WScript.CreateObject("WScript.Shell")
strComputer = "."

' Install Enterprise Vault and return exit code
x = WshShell.Run("msiexec /i Symantec_Enterprise_Vault_Outlook_Add-in-en.msi /qb!",1,True)
msgbox x
' If Enterprise Vault installed successfully Check IE
If x = 0 OR 3010 Then
    msgbox "successful"
    msgbox x

Else

msgbox "quit without installing anything"

End If

WScript.Quit(x)


0 Comments   [ + ] Show comments

Answers (1)

Answer Summary:
x = 0 OR x=3010 should be used in If condition instead of x = 0 OR 3010
Posted by: jagadeish 11 years ago
Red Belt
1

Condtion should be like this..

If x = 0 OR x=3010 Then


Comments:
  • I new I was missing something stupid... It was a long day!!

    Cheers Jagadeish :-) - tmpamlrs 11 years ago
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ