Call a program from C code

Status
Not open for further replies.

kordix

Member level 3
Joined
Jan 18, 2006
Messages
58
Helped
8
Reputation
16
Reaction score
4
Trophy points
1,288
Activity points
1,825
I want to do the same thing like:

FOR /F %i IN (list_file.txt) DO program.exe %i

in DOS command; in C without passing by DOS, eg without using:
#include <process.h>
...
system("FOR /F %i IN (list_file.txt) DO program.exe %i");
...
or
#include <process.h>
...
while(*file_name)
{
wsprintf(str,"program.exe %s",file_name);
system(str);
.....
}
....

Have anyone a better idea to do this?
thank u.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…