views:

232

answers:

2

How do you generate C# classes for accessing WMI?

+1  A: 

To generate strongly typed WMI classes, use the Management Strongly typed class generator (MgmtClassGen.exe). It's usually in C:\Program Files\Microsoft Visual Studio X\SDK\vX\Bin. The parameters are at MSDN and they even have a page describing the code generated. If you have to do a lot of work with WMI, it's a lifesaver.

VanOrman
+2  A: 

You can try WMICodeCreator it generates vbscript jscript vb.net and c# code Download WMICodeCreator from Microsoft

Napco