Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I started using a standard uninstall script, and it wasn't working, so I decided to see if it was even finding any progams at all, and it seems it isn't. It works on Windows 7 but not on the other the Windows 2003 server I need to use it on. I'm logged in as local Admnistrator,

The script below created the error:

Line: 4
Char: 1
Error: 0x80041010
Code: 80041010
Source: (null)

Code:

strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSoftware = objWMIService.ExecQuery ("Select * from Win32_Product")
For Each objSoftware in colSoftware
    MsgBox("hi")
Next
share|improve this question

1 Answer 1

up vote 1 down vote accepted

The error code you see is "Invalid Class". Server 2003 does not include the MSI Provider for WMI by default.

From Operating System Availability of WMI Components:

Windows Server 2003: The Windows Installer provider—also known as the MSI provider—is included on the CD as an optional Windows component that you can install using Control Panel. Optional installation of the Windows Installer provider ensures backward compatibility with the Windows XP and Windows 2000 feature sets.

You'll need to install from

  • "Add Remove Windows Components"
    • "Management and Monitoring Tools"
      • "WMI Windows Installer Provider"

enter image description here

share|improve this answer
    
Ok, I don't have the disk to install the component at the moment but that looks right. Thanks. –  David Jul 10 '12 at 18:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.