Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!ucsd!nprdc!keck From: keck@nprdc.arpa (John Keck) Newsgroups: comp.lang.c Subject: Re: execl()'ing batch files in DOS Message-ID: <2434@arctic.nprdc.arpa> Date: 13 Jun 89 18:18:54 GMT References: <302@ohs.UUCP> <2896@buengc.BU.EDU> <948@hawkmoon.MN.ORG> Sender: news@nprdc.arpa Reply-To: keck@nprdc.arpa (John Keck) Organization: Navy Personnel R&D Center, San Diego Lines: 11 In article <948@hawkmoon.MN.ORG> det@hawkmoon.MN.ORG (Derek E. Terveer) writes: >In article <2896@buengc.BU.EDU>, bph@buengc.BU.EDU (Blair P. Houghton) writes: >> In article <302@ohs.UUCP> mday@ohs.UUCP (Matthew T. Day) writes: >> >Does anybody know if it's possible to execl() a batch file in DOS? > >I have had problems when exec()ing batch files. It always hung my pc. > A batch file is a script which is interpreted by the shell. You exec the shell specified by environment variable COMSPEC with the name of the file as an arg- ument. For COMMAND.COM, use the -C flag. All of this is done for you by the system() function.