From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,89c5ccdf517cb775 X-Google-Attributes: gid103376,public From: Stephen Leake Subject: Re: Executing Command Line Strings From Ada95/GNAT Date: 1997/08/01 Message-ID: <33E1E7DC.A6B@gsfc.nasa.gov>#1/1 X-Deja-AN: 261284065 References: <97073110303193@psavax.pwfl.com> Reply-To: Stephen.Leake@gsfc.nasa.gov Organization: NASA Goddard Space Flight Center -- Greenbelt, Maryland USA Newsgroups: comp.lang.ada Date: 1997-08-01T00:00:00+00:00 List-Id: Marin David Condic, 561.796.8997, M/S 731-96 wrote: > > ... I would like a procedure which will take a string argument > and execute it as a C-Shell or MS-DOS command. I have not seen > anything immediately obvious in the documentation - perhaps it > involves building a binding to some system routine(s). (I'm not > terribly familiar with the system calls for either OS at the > moment - I *write* operating systems, not *use* them ;-) > > If someone knows of some method to do this or has any suggestions, > I'd appreciate hearing from you. Thanks. Yes, you have to use a system call. In the Win32.hlp file, lookup ShellExecute; it seems to do what you want, but as a Windows application, not an MS-DOS app. I haven't used it, so I may be wrong. I think to run a real MS-DOS command, you can call ShellExecute and specify the command string "COMMAND.COM /C "; check the DOS help on COMMAND.COM for details. The semi-standard C library way of doing this is the "system" function; there may be one in the cygwin32 system, and there should be one under Solaris. > > MDC > -- - Stephe