execl()'ing batch files in DOS

Steve Mawer scm at datlog.co.uk
Wed May 24 17:39:22 AEST 1989


In article <2896 at buengc.BU.EDU> bph at buengc.bu.edu (Blair P. Houghton) writes:
>In article <302 at ohs.UUCP> mday at 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        <scm at datlog.co.uk> or < {backbone}!ukc!datlog!scm >
                       Voice:  +44 1 863 0383 (x2153)



More information about the Comp.lang.c mailing list