Rob van der Woude's Scripting Pages


Version 10.0.3


WMIGen 10.0.3 languages list screenshot

Use this program to generate Batch, C, C++, C#, Delphi, F#, Java, JScript, KiXtart, Lua, Object Pascal, (Open) Object Rexx, Perl, PHP, PowerShell, Python, Ruby, Tcl, VB .NET or VBScript code for menu selected WMI queries.

WMIGen 10.0.3 generated code view screenshot

Interactive use:

Command line switches:

  Command line and/or configuration file:
/BW Use high contrast black and white style for the program's window
/CHAIN try to display arrays of (character) numbers both as translated string and as joined array of numbers (default: joined array only)
Note: this option is available for C#, KiXtart, Object Rexx, Perl, PowerShell and VBScript only, it will be ignored for other languages
/DEFNS do not build a list of namespaces, provide only the default namespace (or the one specified by the /NAMESPACE switch)
/LANGUAGE:language specifies the selected scripting or programming language at startup (default: C#)
/MINRES minimize resource use by generated code
Note: this option is available for JScript, KiXtart, Object Rexx, Python and VBScript only, it will be ignored for other languages
/NAMESPACE:namespace specifies the selected WMI namespace at startup (default: root/CIMV2)
/NOADMIN do not show warning message if running without elevated privileges
/NOPERF do not list Performance Monitor classes
/NOUPD do not check for program updates
/SAVETO:directory specify the directory to save results to (default: My Documents)
/SIZE:widthXheight specify the window size (width x height or "MAXIMIZE"; default: 1024 x 600)
/TIMEOUT:seconds specify the timeout in seconds for WMI queries (1..180 seconds; default: 10 seconds)
/WIN32 list Win32_* classes only
  Command line only:
/? show this help
/CLASS:class specifies the selected WMI class at startup (default: first item in list)
/COPY copy result to clipboard and exit (requires either /GENERATE or /RUN, implies /DEFNS and /NOADMIN and /NOUPD)
/GENERATE generate code (requires /CLASS)
/RUN run selected query (requires /CLASS)
/SAVE:file save result to file and exit (requires either /GENERATE or /RUN, implies /DEFNS and /NOADMIN and /NOUPD)



WMIGen requires a paid license for commercial use after an evaluation period; it is free for personal use.



Unlike its HTA predecessor, WMIGen.exe does not require elevated privileges, but if running without them, some namespaces may be inaccessible.
So when running without elevated privileges, the program may take longer to initialize at startup, or when a new namespace is selected.
In that case, a dialog will pop up, explaining the performance issue, and prompting you to restart the program with elevated privileges.
You can use the /NOADMIN command line switch to suppress this dialog when running without elevated privileges.

WMIGen 10.0.3 elevated privileges message

You can also use the /DEFNS command line switch to speed up program load by providing only the default or specified namespace, instead of building a list of all available namespaces.

Switches /GENERATE and /RUN are mutually exclusive.

Generated code for C and C++ won't display arrays, and error handling is not provided.

An optional configuration file can be used to change the program's default settings.
The configuration file's path and filename are identical to the program's, the extension is ".cfg".
A configuration file can be created using the "Save" button in the Settings window, or it can be typed directly in Notepad or any other plain text editor.

When the program is loaded, default settings are applied first.
Next, if a configuration file exists, it will be loaded and interpreted.
The command line will be interpreted after that.
In case of conflicts, command line settings will always prevail over configuration file settings.

The "Copy" and "Save" buttons' function depends on the context:



This program is based on the Microsoft TechNet ScriptCenter article Scripting Eye for the GUI Guy, now renamed to A Scriptomatic You Can Call Your Own.

This program was created with the help of Windows' native WBEMTEST command and the Scripting Guys' Scriptomatic tool.

Language code samples:

MSDN Help search based on Google Search and completed with help from Search Engine Roundtable

Code to extract icon from Shell32.dll by Thomas Levesque

Code to follow hyperlinks in the Help text by Sam Meldrum



Change History

10.0.3 2017-08-19
  • Tcl was added to the list of supported languages
  • An error was fixed in the "Run" screen output
10.0.2 2017-08-18
  • PHP was added to the list of supported languages
  • Python scripts can be generated as either Python 2 or Python 3 scripts
10.0.1 N/A Never made it to publication 2016-12-15 First "final" release

Versions published before 10.0

are the old HTA version of the

program, which is still available

but no longer maintained.


Download WMI Code Generator 10.0.3:


File name:


Make a donation:

page last uploaded: 2017-08-20, 10:26