|Generate source code in the selected scripting or programming language, for the selected WMI query|
|Use this HTA to generate Batch, C#, Delphi, F#, Java, JScript, KiXtart, Lua, Object Pascal, (Open) Object Rexx, Perl, PowerShell, Python, Ruby, VB .NET or VBScript code for selected WMI queries.|
|First select a WMI namespace from the dropdown list, or stick with the default (
If a warning message, suggesting to abort the script, appears after selecting a namespace, click "No" to continue reading the list of available classes.
|Next, select a class from the dropdown list marked "Select a WMI class", or use the search field to jump to the first (or next) match.
The "Properties" and "Methods" fields will show the properties and methods available for the selected class, if any.
|To get detailed information on a class or a method or property, select that class (and optionally a method or property) and click the "MSDN Help" button.
This will open your default browser with a list of relevant Google Search results.
|Select a scripting or programming language from the drop-down list and click the "Generate Code" button to generate the code that will display all properties of the selected class, and their values, in the scripting or programming language of your choice.|
|To test the selected query on your own computer, click the "Run WMI Code" button and wait for the result to appear on screen. Click "Generate Code" once more to redisplay the code in the selected scripting language.|
|Click "Save" to save the generated code (or query result) to a file, or "Copy" to copy it to the clipboard.|
|Command Line Usage|
|Options:||The following options can be set in the configuration file or on the command line
(in case of conflicts, the command line overrules the configuration file)
|/NAMESPACE:namespace||Specifies the initial WMI namespace to be opened (default:
|/FAST||Skip the query to populate the namespaces list, an "populate" this list with the value specified by the
|/LANGUAGE:language||Specifies the initial programming or script language;
|/LOWRES||Generate code that uses less resources, at the cost of the results being "read-once" only (ignored for C#, F#, Java, Lua, PowerShell and VB.NET)|
|/SPACES||Insert spaces in property name descriptions, e.g. "
|/WRAP||Enable (soft) word wrap in the generated code field (does not affect saved code)|
|/SIZE:WxH||Center window and resize to W x H pixels
|/BW||Change the HTA's style to high contrast black and white|
|/NOUPD||Skip check for updates at startup|
|Switches:||The following options can only be set on the command line|
|/CLASS:class||Specifies the WMI class to be selected|
|/GENERATE||Generate the code immediately
|/RUN||Run the generated VBScript code immediately
|/COPY||Copy the generated code or result to the clipboard
|/SAVE:"filename"||Save the generated code or result to a file
||Show this message|
|Notes:||1:||The optional configuration file is named "WMIGen.cfg", and must be located in the same folder where this HTA is located.
"WMIGen.cfg" is formatted as a single command line, e.g.
|2:||Command line arguments will always prevail over "WMIGen.cfg" settings!|
|3:||To run without any user interaction requires one of the following combinations of command line arguments:
|4:||If the extension of
|5:||On startup, the HTA checks if it is running with elevated privileges, and displays an error message if not.
On 64-bit systems, HTAs may be incorrectly associated with the 32-bit MSHTA.EXE (
In that case, add the path to the proper (64-bit) MSHTA to this HTA's command line:
|6:||Also on startup, the HTA checks if an update is available, and will prompt you to download and install it if so.|
|Examples:||WMIGEN.HTA /WIN32 /NOPERF /SIZE:1024x768|
|WMIGEN.HTA /NAMESPACE:root/WMI /CLASS:WmiMonitorID /GENERATE /SAVE:"monitor_inventory.bat"|
|WMIGEN.HTA /NAMESPACE:root/WMI /CLASS:WmiMonitorID /RUN /COPY
|WMIGEN.HTA /CLASS:Win32_BIOS /LANGUAGE:C# /GENERATE /SAVE:"bios_query.cs"|
WMI Code Generator, Version 9.03
© 2006 - 2016 Rob van der Woude
|page last uploaded: 2016-10-11, 12:29|