Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: Spawing Win32 Processes

by joefission (Monk)
on Aug 17, 2001 at 22:22 UTC ( #105761=note: print w/replies, xml ) Need Help??

in reply to Spawing Win32 Processes

use Win32::Process; use strict; my $ProcessObj; Win32::Process::Create($ProcessObj, "c:/perl/bin/perl.exe","perl test1", 0, DETACHED_PROCESS, "."); my $pid = $ProcessObj->GetProcessID(); print "$pid\n";
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.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://105761]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2020-06-02 17:41 GMT
Find Nodes?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?

    Results (19 votes). Check out past polls.