I'm having a hard time getting this to work as expected:
Win32::Process::Create(my $ProcessObj,
"c:\\windows\\system32\\cmd.exe",
"/c c:\\test\\slowproc.cmd | tee.exe processlog";,
0,
NORMAL_PRIORITY_CLASS,
".") || die ErrorReport();
unless ($ProcessObj->Wait($timeout * 1000)) { $ProcessObj->Kill(1) };
When I run it, the Kill works and returns control to the Perl script, but the slowproc.cmd and tee keep on going in the background. If I just run slowproc without tee, Kill ends it properly.
The PID in question is the PID of the cmd.exe process, as you'd expect. Doing tests on the command line show that it works if you put quotes around the "slowproc.cmd | tee processlog" part, but that doesn't seem to have any effect in the Perl script.
Has anybody gotten chained commands like this to work with Win32::Process?
---
A fair fight is a sign of poor planning.