Hi all
I'm trying to figure out how I can get the status of a process that I create
via WMI on a remote computer I want my script to be able to fire up a
series of processes on different machines sequentially so it'll need to
wait for the first one to finish I'm taking some of Roth's basic code for
handling this such as:
use Win32::LE qw( in );
use Win32::LE::Variant;
$strServer = $ARGV[0];
$strClass = "WinMgmts:{impersonationLevel=impersonate}!//$strServer";
$objWMI = Win32::LE->G( $strClass )
|| die "Unable to connect to \\$strServer <file://$strServer/>:" .
Win32::LE->LastError();
$objProcess = $objWMI->Get( "Win32_Process" )
|| die "Unable to get the process list:" . Win32::LE->LastError();
$varPID = Variant( VT_I4 | VT_BYREF, 0 );
if( 0 == $objProcess->Create( "perl.exe d:\\dummy.pl", undef, undef, $varPID
) ) {
print "Process successfully created with PID $varPID\n";
} else {
print "Failed to create process.\n";
}
print $objProcess->{ProcessId}."\n";
It appears that I can't get any information about the process via the
$objProcess object once I kick it off
Any ideas?
Andy Speagle
Perl-Win32-Users mailing list
Perl-Win32-Users (AT) listserv (DOT) ActiveState.com
To unsubscribe: