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.
User avatar
jjimenez
Posts: 12
Last visit: Wed Dec 31, 1969 4:00 pm

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: 14704
Last visit: Sat Feb 27, 2021 5:46 am
Answers: 8
Has voted: 2 times
Been upvoted: 6 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: Wed Dec 31, 1969 4:00 pm

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.

Locked