[comp.sys.ibm.pc] execl

dhesi@bsu-cs.bsu.edu (Rahul Dhesi) (05/18/89)

>>	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 <dhesi@bsu-cs.bsu.edu>
UUCP:    ...!{iuvax,pur-ee}!bsu-cs!dhesi