🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.os2.programmer
Article #2331

Re: Executing a program from within a program

#2331
From: Kenneth A. Kahn
Date: Tue, 06 Oct 1992 22:32
13 lines
1163 bytes
In <kaz.718396549@pv7b82.vincent.iastate.edu> Jimmy Buffet writes:
>Is there an OS/2 function I can call to execute a program within a program
>(for example, call dir within a program).  Also, is there a list
>of standard OS/2 file and dir functions I can get anywhere?  Thanks!
>
>--
Check on the DosExecPgm API; it allows you to start either child programs
either Synchronously or Asynchronously.  For example in your case you would
code the following:

    DosExecPgm(NULL,0,EXEC_SYNC,"CMD.EXE\0/K DIR\0",NULL,&RC,"CMD.EXE");

If you want to redirect stdOUT to trap the DIR output, see DosDupHandle.
Technical Details
Message-ID: <19921006.153413.154@almaden.ibm.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!PKSMRVM.VNET.IBM.COM
References: <kaz.718396549@pv7b82.vincent.iastate.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!PKSMRVM.VNET.IBM.COM
From: KENKAHN@PKSMRVM.VNET.IBM.COM (Kenneth A. Kahn)
Message-ID: <19921006.153413.154@almaden.ibm.com>
Date: Tue, 6 Oct 92 18:32:33 EDT
Newsgroups: comp.os.os2.programmer
Subject: Re: Executing a program from within a program
Organization: Staff of IBM Fellow - IBM Personal/370
Disclaimer: This posting represents the poster's views, not those of IBM
News-Software: UReply 3.0
X-X-From: KENKAHN@PKSMRVM.VNET.IBM.COM (Ken Kahn)
References: <kaz.718396549@pv7b82.vincent.iastate.edu>
Lines: 13