Is there any way to get the results from Win32::Process::Create ??
I have the following script that creates a process successfully. I need
to get the results of running the process how can I do this?
sub createProcess {
$App = shift; # "c:\\webserver\\webserver.exe";
$Cmd = shift; # "webserver 192.168.1.10";
$bInherit = 1;
$Flags = CREATE_NEW_PROCESS;
$Dir = $process_directory; #".";
$Result = Win32::Process::Create( $Process,
$App,
$Cmd,
$bInherit,
$Flags,
$Dir);
if( $Result ){
print "I created the process: $Result";
$Process->Wait(30); # RUNS THE PROCESS WITH A 30 SEC TIMEOUT
$PID = $Process->GetProcessID();
$Process->Kill($PID);
}else {
print "Unable to start $Cmd.\n";
print "Error: " . Win32::FormatMessage( Win32::GetLastError() );
}
} # THIS SUBROUTINE WILL CREATE A PROCESS
createProcess("c:\\netsvc.exe", "netsvc OracleOraHome81HTTPServer
\\\\mycomputer /query");
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin