Hi,

I am writing an application that needs to insert some data into WMI.

Now I need to do several things:

Check if Class X exists
If yes delete it.
Create Class X
Create Instance
Insert data into Instance.

In vbscript this is really easy but I can't get my head around how to do it in C++.

The class does not need to survive a reboot as when the program is next run it will recreate everything. So I want to avoid creating MOF files that need to be deployed to the computers the application is run on.

Skelaton Code would be really really appraciated as I am at a bit of a loss even after reading the MS documentation (I can code a bit in C++ but I am far from competent it in).

Regards,

Ryan