Xref: utzoo comp.lang.c:18726 comp.sys.ibm.pc:28945 Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!iuvax!bsu-cs!dhesi From: dhesi@bsu-cs.bsu.edu (Rahul Dhesi) Newsgroups: comp.lang.c,comp.sys.ibm.pc Subject: Re: execl()'ing batch files in DOS Keywords: batch, execl, dos Message-ID: <7253@bsu-cs.bsu.edu> Date: 17 May 89 20:51:45 GMT References: <302@ohs.UUCP> <681@hydra.gatech.EDU> Reply-To: dhesi@bsu-cs.bsu.edu (Rahul Dhesi) Followup-To: comp.sys.ibm.pc Organization: CS Dept, Ball St U, Muncie, Indiana Lines: 21 >> execl("\command.com", "tryit.bat", NULL); >> >>and perror() tells me "No such file or directory." char option[] = "/c"; char *comspec; if (msdos_version <= 3) option[0] = getswitchar(); /* Turbo C 2.0 */ else printf ("Please upgrade to UNIX\n"); if ((comspec = getenv("COMSPEC")) == NULL) comspec = "/command.com"; execl (comspec, comspec, option, "tryit.bat", (char *) NULL); perror ("execl"); I have not tested this. -- Rahul Dhesi UUCP: ...!{iuvax,pur-ee}!bsu-cs!dhesi