Newsgroups: comp.os.msdos.programmer Path: utzoo!utgpu!watserv1!maytag!mks.com!andy From: andy@mks.com (Andy Toy) Subject: Re: MS-DOS EXEC Question Date: Thu, 13 Sep 90 16:28:28 GMT Message-ID: <1990Sep13.162828.5480@mks.com> Organization: Mortice Kern Systems, Waterloo, Ontario, Canada Reply-To: andy@mks.com (Andy Toy) References: <1990Sep7.144359.25202@jarvis.csri.toronto.edu> <1990Sep9.063941.27673@uwasa.fi> In article <1990Sep9.063941.27673@uwasa.fi> ts@uwasa.fi (Timo Salmi LASK) writes: [in Turbo Pascal] >SwapVectors; >Exec (GetEnv(comspec), '/c ' + 'your command'); >SwapVectors; >If DosError <>0 then whatever; Is there an equivalent way to do this in Turbo C/C++? In other words, how do you get the return code of 'your command' instead of the return code of `comspec' (command.com) which is usually zero since command.com doesn't return the return code of the command run with `/c' option. Does SwapVector do some magic to get the return code of `your command' instead of that of command.com? -- Andy Toy, Mortice Kern Systems Inc., Internet: andy@mks.com 35 King Street North, Waterloo, UUCP: uunet!watmath!mks!andy Ontario, CANADA N2J 2W9 Phone: 519-884-2251 FAX: 519-884-8861