It returns control to the C program, in the previous example the only thing left to do was exit so...
I don't know a good way to search for a file in all directories.Code:#include <stdio.h> int main() { system("Phile"); printf("First batch file executed"); system("OtherPhile"); printf("Another file executed"); getch(); //leet pause return 0; }
Maybe you could execute a system("dir /AD > dir.txt");
And then read all directories from the dir.txt file into an array or something and use that...
Maybe it is possible in C to read system() output, in Java at least this is possible, my knowledge in C is very limited though in such things.
From a design point of view it would be better of course not to use the method I just mentioned, it should possible to implement this in C relatively uncomplicated.




Reply With Quote