Look at Win32 Process Output you may have to do some serious STDOUT redirecting stuff though. Here is some code..
#!perl.exe
use Win32::Process;
pipe(READ, WRITE);
close(WRITE);
select(READ);
$| = 1;
select(STDOUT);
open(SAVEIN, "<&STDIN") || die "Can't save STDIN\n";
open(STDOUT, "<&READ") || die "Can't redirect STDOUT\n";
select(STDIN);
$| = 1;
select(STDOUT);
Win32::Process::Create($Process,
"c:\\dev\\MiscTests\\Process\\name.exe",
"name",
1,
NORMAL_PRIORITY_CLASS,
".") or die &Error;
chomp($num = "&READ");
open(STDIN, "<&SAVEIN");
close(SAVEIN);
close(READ);
sleep 5;
print "\n\n================================\n";
print "You entered $num\n";
print "About to terminate....\n";
print "End.\n";
sub Error
{
print Win32::FormatMessage( Win32::GetLastError() );
}
open(FILE, "processlog"); chomp( my $var = <FILE> ); close(FILE);
Name.exe is a helloworld type program that returns a name to STDOUT.HTH
-----
Of all the things I've lost in my life, its my mind I miss the most.
|