Rob van der Woude's Scripting Pages


Version 10.0.10


WMIGen 10.0.10 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.10 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 not available for C, C++, Delphi, F#, Java and Object Pascal, the /CHAIN switch will be ignored for these 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.10 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:

As of version 10.0.10 the .NET Framework 4.5 is required.



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.10 2018-12-06
  • Improved search feature, now also in generated code and query result windows
  • Update and license checks now use a secure connection
10.0.9 2018-11-10
  • Fixed a bug in the generated batch code
10.0.8 2018-03-08
  • The namespaces dropdown will now resize with the program window to prevent long namespace paths from being truncated (provided the window and hence the screen is large enough)
  • Improved Windows 10 compatibility
10.0.7 N/A Intermediate release for testing, never officially released
10.0.6 2017-08-30
  • The generated Batch, JScript, Lua, PHP, Python, Ruby, VB .NET code is now also capable of showing arrays of numbers as strings (/CHAIN command line switch)
  • Some display errors for arrays (prefixes, suffixes and separators) in the "Run" window's output have been corrected
10.0.5 2017-08-25
  • The generated Tcl code is now also capable of showing arrays of numbers as strings (/CHAIN command line switch)
10.0.4 2017-08-23
  • The generated Tcl code now also accepts an optional remote computer name on the command line
  • The generated Tcl code now also shows the number of instances
  • And last but not least: error handling has been added to the generated Tcl code
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.10:


File name:


Make a donation:

page last uploaded: 2018-12-20, 10:50