Call program(batch file) with C function.

ENGLISH:
 How to call a program(or a batch file)
 with a C function?
PLEASE, send me code.
Thanks

FRANÇAIS:
 Comment appeller un programme
 éxécutable(ou un batch file) à partir
 d'une fonction en C?
SVP, envoyez-moi du code.

Merci
jhc73Asked:
Who is Participating?
 
imladrisConnect With a Mentor Commented:
The following will do a directory on the current directory of c drive on a DOS machine. You can substitute anything for "dir c:" that is a legal command to the command line processor on your system.


int main(argc,argv)
int argc;
char *argv[];

{   system("dir c:");
    exit(0);
}

0
 
imladrisCommented:
Any ANSI C compiler will provide the function:

int system(char *command);


This function will hand the string in command to a commandline process for execution.
0
 
jhc73Author Commented:
Can you give me more information or an example?
0
All Courses

From novice to tech pro — start learning today.