Win32::Process
This module provides access to extended Win32 process
creation and management abilities. Process objects are created with
the Create method (the
constructor). Additional methods can be used on objects to kill,
suspend, resume, and set the priorities of processes.
The Create constructor has
the following syntax:
Win32::Process->Create($Proc,app,cmnd,hndls,opts,dir)
The arguments to Create are
as follows:
$ProcName of the reference for the created process object.
appFull pathname of the executable.
cmndCommand line for executable.
hndlsDetermines handle inheritance. A value of
1turns on inheritance; a0value turns it off.optsSets options to implement when the process is created. The available options for this argument are listed below.
dirThe working directory for the executable.
The process is created by passing the command line in
cmnd to the executable named in
app. For example, a process object for a
text file running in Notepad is created like this:
use Win32::Process;
Win32::Process->Create($proc, 'C:\\windows\\Notepad.exe',
"Notepad perlnut.txt", 1,
DETACHED_PROCESS, ".");The process creation options given by the
opts argument to Create are:
CREATE_DEFAULT_ERROR_MODEGives the process the default error mode.
CREATE_NEW_CONSOLECreates a new console for the process. Can’t be used with
DETACHED_PROCESS.CREATE_NO_CONSOLECreates a new process, but without running the process in a new and visible window. That is, a new process will be created, but in the background.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access