Sprad has asked for the wisdom of the Perl Monks concerning the following question:
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.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) };
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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Win32::Process and tee
by BrowserUk (Patriarch) on Mar 23, 2004 at 05:06 UTC | |
by Sprad (Hermit) on Mar 23, 2004 at 20:27 UTC | |
Re: Win32::Process and tee
by paulbort (Hermit) on Mar 23, 2004 at 03:41 UTC |