Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!agate!garnet.berkeley.edu!ked From: ked@garnet.berkeley.edu (Earl H. Kinmonth) Newsgroups: comp.lang.c Subject: Re: execl()'ing batch files in DOS Message-ID: <24526@agate.BERKELEY.EDU> Date: 17 May 89 21:35:50 GMT References: <302@ohs.UUCP> <2896@buengc.BU.EDU> Sender: usenet@agate.BERKELEY.EDU Organization: University of California, Berkeley Lines: 30 >> >> execl("\command.com", "tryit.bat", NULL); >> There are a number of errors in this. The proper call to execl is execl(char *path, char *arg0, char *arg1, char *argN, NULL); Usually path = arg0 = executable program name. Second, command.com -c string is the pattern used to get command.com to execute something other than keyboard input. Assuming command.com is in the root directory of drive c:, try the command: path = "c:/command.com"; execl(path,path,"-c","tryit.bat",NULL); You should not need to use the backslash. If your version of execl is brain-dead and you must use a backslash, double it to get proper string interpretation. Earl H. Kinmonth History Department University of California, Davis Davis, California 95616 916-752-1636 (2300-0800 PDT for FAX) 916-752-0776 (secretary) ucbvax!ucdavis!ucdked!cck (email) cc-dnet.ucdavis.edu [128.120.2.251] (request ucdked, login as guest)