Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!mcvax!ukc!stl!stc!datlog!scm From: scm@datlog.co.uk ( Steve Mawer ) Newsgroups: comp.lang.c Subject: Re: execl()'ing batch files in DOS Message-ID: <2030@dlvax2.datlog.co.uk> Date: 24 May 89 07:39:22 GMT References: <302@ohs.UUCP> <2896@buengc.BU.EDU> Reply-To: scm@datlog.co.uk ( Steve Mawer ) Organization: Data Logic Ltd, Queens House, Greenhill Way, Harrow, London. Lines: 30 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: >> execl("\command.com", "tryit.bat", NULL); >> >replace the single backslash with a double backslash, and the first will >cause the second to be interpreted literally _by_the_compiler_... > > execl("\\command.com", "tryit.bat", NULL); > >now the string itself will contain the backslash. > Correct me if I'm wrong (as if you wouldn't :-) but the syntax for execl is: execl(pathname, arg0, arg1..., argn, NULL); so the first argument that command.com will see after its name is NULL. Shouldn't the statement say: execl("\\command.com", "command.com", "tryit.bat", NULL); It's some time since I used MSC on DOS (but I'm thankful for small mercies) and I haven't got the facilities (or the will) to check this out myself. Hope this helps. -- Steve C. Mawer or < {backbone}!ukc!datlog!scm > Voice: +44 1 863 0383 (x2153)