How to display what service pack is installed

Koz

Member
Joined
Dec 13, 2011
Messages
8
Programming Experience
Beginner
Hi,

I am not sure how to do this, I need to output what service pack is installed on a windows 7 machine along with what antivirus is installed. Any idea on how I would get that information using VB?

Thank you!
 
ServicePack Property

Found also some variations of this code for AV detection, requires you to add reference to System.Management assembly first:
        Dim searcher As New Management.ManagementObjectSearcher("Select * From AntivirusProduct")
        searcher.Scope = New Management.ManagementScope("\root\SecurityCenter2")
        For Each instance As Management.ManagementObject In searcher.Get()
            Debug.WriteLine(instance("displayName").ToString())
        Next instance
 
Thanks, or maybe a batch file would be easier?
No.
I found out I need to see if Office 2010 service pack 1 is installed, is this possible>?
I would look in registry, at LastProduct name/value pair probably in this key:
VB.NET:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\14.0\Common\ProductVersion
Registry can be accessed in VB for example using My.Computer.Registry object.
Maybe you'll find a value that compares to this article: How to determine which version of an Office 2010 product is installed
FileVersionInfo class from System.Diagnostics namespace can be used if you want to take that route.
 
Back
Top