help combining 2 scripts

Anything VBScript-related, including Windows Script Host, WMI, ADSI, and more.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 10 years and 3 weeks old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
jjimenez
Posts: 12
Last visit: Fri Mar 07, 2014 8:23 am

Re: help combining 2 scripts

Post by jjimenez »

thank you. I think i can use that.

Ultimately it has to satisfy 1 of 3 results while checking the 2 reg keys, but only outputing 1 result.

installed up to date
installed not up to date
not installed

but thanks again.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: help combining 2 scripts

Post by jvierra »

You are at liberty to change the messages to say anything you like.
User avatar
jjimenez
Posts: 12
Last visit: Fri Mar 07, 2014 8:23 am

Re: help combining 2 scripts

Post by jjimenez »

this appears to work properly.
VBScript Code
Double-click the code block to select all.
sProductIdentifier = "{25D1F70B-0B90-495C-8ADC-4FF0855EF92E}"
dversion = "11.9.4.634"
 
sVersion = GetProductVersion("HKLM\software\microsoft\windows\currentversion\uninstall\" & sProductIdentifier & "\DisplayVersion")
sVersion1 = GetProductVersion("HKLM\software\wow6432node\microsoft\windows\currentversion\uninstall\" & sProductIdentifier & "\DisplayVersion")

If (sVersion >= dversion) Then
	wscript.echo "Compliant"

Elseif sVersion <> "" Then
    WScript.Echo sVersion

ElseIf (sVersion1 >= dversion) Then
	wscript.echo "Compliant"

Elseif sVersion1 <> "" Then
    WScript.Echo sVersion1
    
Else wscript.echo "Not Installed"

  WScript.Quit
End If
 
Function GetProductVersion(sValuePath)
    On Error Resume Next
    GetProductVersion = createobject("wscript.shell").Regread( sValuePath ) 
End Function
thanks for all the help.
This topic is 10 years and 3 weeks old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked