Is there a way to generate WMI code/classes?

折月煮酒 提交于 2019-11-29 04:30:14

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.

Donal Lafferty

Easier approach (Visual Studio users):

  1. Add WMI classes to VisualStudio's Server Explorer. E.g.

  2. Get Visual Studio to call MgmtClassGen.exe for you. E.g.

@VanOrman provides additional references for MgmtClassGen.exe.

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!