Set colSoftware = objWMIService.ExecQuery _
("SELECT * FROM Win32_Product")
If colSoftware.Count > 0 Then
I'm trying to run this peice of code on my Win2003 machine. The execution stops at the line: "If colSoftware.Count > 0 Then " with "SWbemObjectSet
Invalid class" error does anyone know how I can fix it ?
The issue is that the 'Win32_Product' class is not installed on Windows 2003 Server by default. You can install it using 'Add or Remove Programs' dialog - click the 'Add/Remove Windows Components' button and enable the 'Management and Monitoring Tools | WMI Windows Installer Provider' option.