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 1 month 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.
I'd like the following script to only put out one result. Either the 64bit app is compliant/non compliant/ or not installed or the 32 bit section is such.
VBScript Code
Double-click the code block to select all.
const HKEY_LOCAL_MACHINE = &H80000002
on error resume next
Dim dversion, GUIDid
dversion = "6.1.20913.0"
GUIDid = "{89F4137D-6C26-4A84-BDB8-2E5A4BB71E00}"
set oWsh = createobject("wscript.shell")
Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
strKeyPath = "software\microsoft\windows\currentversion\uninstall"
sDisplayVersion = oWsh.Regread("HKLM\" & strKeyPath & "\" & GUIDid & "\DisplayVersion")
oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, strValueName, strValue
if err.number <>0 then
wscript.echo "Not-Installed"
err.clear
else
If Eval("sDisplayVersion >= dversion") Then
wscript.echo "Compliant"
Elseif Eval("sDisplayVersion < dversion") Then
wscript.echo sDisplayVersion
End if
End if
strKeyPath = "software\wow6432node\microsoft\windows\currentversion\uninstall"
sDisplayVersion = oWsh.Regread("HKLM\" & strKeyPath & "\" & GUIDid & "\DisplayVersion")
oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, strValueName, strValue
if err.number <>0 then
wscript.echo "Not-Installed"
err.clear
else
If Eval("sDisplayVersion >= dversion") Then
wscript.echo "Compliant"
Elseif Eval("sDisplayVersion < dversion") Then
wscript.echo sDisplayVersion
End if
End if
it does both right now, please help me seperate them.
const HKEY_LOCAL_MACHINE = &H80000002
dversion = "6.1.20913.0"
GUIDid = "{89F4137D-6C26-4A84-BDB8-2E5A4BB71E00}"
set oWsh = createobject("wscript.shell")
On Error Resume Next
strKeyPath = "software\microsoft\windows\currentversion\uninstall"
sDisplayVersion = oWsh.Regread("HKLM\" & strKeyPath & "\" & GUIDid & "\DisplayVersion")
if err.number <>0 Then
wscript.echo "Not-Installed in 32 bit registry"
Else
if(sDisplayVersion >= dVersion) Then
WScript.Echo "Up to date:" & sDisplayVersion
Else
WScript.Echo "Not up to date:" & sDisplayVersion
End If
WScript.Quit
End If
strKeyPath = "software\wow6432node\microsoft\windows\currentversion\uninstall"
sDisplayVersion = oWsh.Regread("HKLM\" & strKeyPath & "\" & GUIDid & "\DisplayVersion")
if err.number <> 0 then
wscript.echo "Not-Installed in 32 bit registry"
else
if(sDisplayVersion >= dVersion) Then
WScript.Echo "Up to date:" & sDisplayVersion
Else
WScript.Echo "Not up to date:" & sDisplayVersion
End If
End If
So you don't ever want to search 32 bit subsytems?
This is all you wanted:
VBScript Code
Double-click the code block to select all.
const HKEY_LOCAL_MACHINE = &H80000002
dversion = "6.1.20913.0"
GUIDid = "{89F4137D-6C26-4A84-BDB8-2E5A4BB71E00}"
set oWsh = createobject("wscript.shell")
On Error Resume Next
strKeyPath = "softwaremicrosoftwindowscurrentversionuninstall"
sDisplayVersion = oWsh.Regread("HKLM" & strKeyPath & "" & GUIDid & "DisplayVersion")
if err.number <>0 Then
wscript.echo "Not-Installed in 32 bit registry"
Else
if(sDisplayVersion >= dVersion) Then
WScript.Echo "Up to date:" & sDisplayVersion
Else
WScript.Echo "Not up to date:" & sDisplayVersion
End If
WScript.Quit
End If
This topic is 10 years and 1 month 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.