Jump to content

QUERY: detect MS Installer or any exe file Version Number?


Recommended Posts

Posted

I liked the VBS detect scripts to detect whether .NET is installed and which version.

Does anyone know if it's possible to detect whether Microsoft Installer 3.1 (KB893803) or later?

Also, does anyone know if it's possible to read file version number of an executable?


Posted
I liked the VBS detect scripts to detect whether .NET is installed and which version.

Does anyone know if it's possible to detect whether Microsoft Installer 3.1 (KB893803) or later?

Also, does anyone know if it's possible to read file version number of an executable?

Here is a script that will list the KB info you wanted and the version of net frameworked installed

StrComputer = "."
Dim objQuickFix, RP_1, RP_2, RP_3, RP_4, Ts
Dim Uptotal : Uptotal = 0
Dim ObjWMI : Set ObjWMI = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & StrComputer & "\root\cimv2")
Dim colQuickFixes : Set colQuickFixes = ObjWMI.ExecQuery("Select * from Win32_QuickFixEngineering")
'/-> WMI Querry For The KB
If colQuickFixes.Count = 0 Then
WScript.Echo "No Installed updates"
End If
For Each objQuickFix in colQuickFixes
RP_1 = objQuickFix.Description
RP_2 = objQuickFix.HotFixID
RP_3 = objQuickFix.InstalledOn
RP_4 = objQuickFix.InstalledBy
If InStr(RP_1,"Windows") Then
If InStr(RP_1,"KB893803") Then
MsgBox "Confirm Window Installer" & vbCrLf & RP_1 & vbCrLf & RP_2, 0 + 32, "Window Installer"
End If
End If
Next

Dim NetRpt
'/-> Querry For Net Framework
Set colItems = ObjWMI.ExecQuery("Select * from Win32_Product")
For Each objItem in colItems
If InStr(objItem.Name, "Microsoft .NET Framework") > 0 Then
NetRpt = NetRpt & vbCrLf & objItem.Version
End If
Next
MsgBox NetRpt, 0 + 32, "Net Frame Work"

Yes to the second question

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...