http://www.perlmonks.org?node_id=105761


in reply to Spawing Win32 Processes

test.pl:

use Win32::Process; use strict; my $ProcessObj; Win32::Process::Create($ProcessObj, "c:/perl/bin/perl.exe","perl test1 +.pl", 0, DETACHED_PROCESS, "."); my $pid = $ProcessObj->GetProcessID(); print "$pid\n";
test1.pl:
open(FILE,">c:/tada.txt"); print FILE "hello\n"; close FILE;

Alternatively, you could try start /B which is supposed to start an application without starting a new window.

Replies are listed 'Best First'.
Re: Re: Spawing Win32 Processes
by Anonymous Monk on Aug 17, 2001 at 23:41 UTC
    If you want no window to pop up you can replace DETACHED_PROCESS in the example above with (DETACHED_PROCESS | CREATE_NO_WINDOW) which I've successfully used to supress an app that insisted on spawning a new console window. Seems output from the supressed app (if there is any) gets passed to STDERR.

    If you don't want that but want console interaction of some sort, look at the Win32::Console module.

    Glenn