Support Forums

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.
User avatar
jjimenez
Posts: 12
Joined: Sun Mar 02, 2014 12:28 pm

Re: help combining 2 scripts

Postby jjimenez » Fri Mar 07, 2014 7:18 am

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.
User avatar
jvierra
Posts: 10032
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: help combining 2 scripts

Postby jvierra » Fri Mar 07, 2014 7:53 am

You are at liberty to change the messages to say anything you like.
User avatar
jjimenez
Posts: 12
Joined: Sun Mar 02, 2014 12:28 pm

Re: help combining 2 scripts

Postby jjimenez » Fri Mar 07, 2014 9:23 am

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.

Return to “VBScript”

Who is online

Users browsing this forum: No registered users and 2 guests