Win32::WMIC - Access to the MS Windows Management Instrumentation Utility!
WMIC extends WMI for operation from several command-line interfaces and through batch scripts. Understand?
Essentially, MS Windows captures a crap-load of information about the system, users, hadware, etc and now makes it available via the wmic command-line utility.
See this URL for more details: [last checked Mon Dec 28 21:42:44 2009 ] http://technet.microsoft.com/en-us/library/bb742610.aspx
Use it in Perl...
use Win32::WMIC; my $wmic = Win32::WMIC->new(); my $csv = $wmic->query('process list')->data; # get processes my $data = $wmic->parse;
the `new` method is used to instantiate a new Win32-WMIC object
new usage and syntax
my $wmic = Win32::WMIC->new; takes 0 arguments example: my $wmic = Win32::WMIC->new;
the `query` method is used to issue commands against the wmic utility
query usage and syntax
$wmic->query($query); takes 1 argument 1st argument - required $query - a single valid wmic command string example: my $query = 'useraccount list breif'; $wmic->query($query);
the `data` method is used to output the raw unprocessed resultset returned from the wmic query
data usage and syntax
$wmic->data; takes 0 arguments example: my $raw_resultset = $wmic->data;
the `parse` method is used to produce a perl object from the wmic query resultset
parse usage and syntax
my $data = $wmic->parse; takes 2 arguments 1st argument - optional $where - a SQL::Abstract hashref where-clause construct 2nd argument - optional $order - a SQL::Abstract arrayref order-clause construct example: my $data = $wmic->parse;
<awncorp at cpan.org>
Please report any bugs or feature requests to
bug-win32-wmic at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Win32-WMIC. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
You can find documentation for this module with the perldoc command.
You can also look for information at:
Copyright 2009 Al Newkirk, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.