PWB Extensions Help (ext.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
DoSpawn
                                             Up Contents Index Back
─────PWB Extensions─────────────────────────────────────────────────────────
 
  Syntax:  flagType DoSpawn( char far *Command, char far *Output,
                             unsigned flFlags, unsigned far *puReturn );
 
  Returns: True when command shell succesfully spawned, false when the
           command shell could not be run.
 
  See:     fExecute
 
     The DoSpawn function runs an operating-system command by starting
     the operating-system command processor specified by the COMSPEC
     environment variable. The command processor is normally COMMAND.COM
     for MS-DOS systems.
 
     Argument       Description
 
     <Command>      Operating-system command line to execute.
 
     <Output>       Name of a disk file to receive the redirected output
                    from the command. If specified, you must also set
                    the EXTCMD_REDIR or EXTCMD_APPEND flags in the
                    <flFlags> argument. Specify NULL for <Output> when
                    not redirecting.
 
     <flFlags>      A set of bit flags that specifies options for
                    running the command. Combine one or more of the
                    following constants by using the bitwise-OR
                    operator (|):
 
                    Constant        Option
 
                    EXTCMD_NONE     (No special options.)
                    EXTCMD_NOEVENT  Do not notify extensions of spawn.
                    EXTCMD_NOSAVE   Do not autosave before spawning.
                    EXTCMD_NOSYNC   Do not synchronize the current file
                                    on return.
                    EXTCMD_REDIR    Write output to <Output>.
                    EXTCMD_APPEND   Append output to <Output>.
                    EXTCMD_BACK     Run <Command> in the background.
                    EXTCMD_ECHO     Echo output as the command executes.
                                    The output is saved in the Build
                                    results window.
                    EXTCMD_ASK      Always prompt on return.
                    EXTCMD_ASKERR   Prompt on return if error.
                    EXTCMD_GLOBAL   Prompt on return if the Askrtn
                                    switch is set to Yes.
 
     <puReturn>     Pointer to a variable that receives the exit code
                    from the command processor.
                                    -♦-