Monday, July 4, 2011

Perlscript WMI Example using InstancesOf

You can download the scripting program for generating these scripts at:

http://www.planetmps.com/wmiscriptsinstancesof.html

use Win32::OLE( 'in' );
my $locator = Win32::OLE->CreateObject("WBemScripting.SWbemLocator");
my $svc = $locator->ConnectServer();
$objs = $svc->InstancesOf("Win32_Process");
my $mystr = "";
foreach my $obj (in($objs)
{
    foreach my $prop (in($obj->Properties_)
    {
    }
last;
}

No comments:

Post a Comment