Hi all.
If I was to open up a DOS window, and type:
I'd get a list of html files in the "project" directory.Code:dir "c:\examples\programs\project\*.html"
But when I try to get the same results using the system() command:
I get the error message "File Not Found".Code:#include <stdlib.h> #include <stdio.h> int main( void ) { system("dir c:\examples\programs\project\*.html"); return 0; }
I've tried various combinations of:
to no avail, even though they compile OK.Code:system("dir ""c:\examples\programs\project\*.html""");
If I was to use system("dir"), and put the executable into the "projects" folder, everything works fine.
But how can I use the system() command so that it will give me a listing of any directory that I choose? Is even possible to use literal strings in system()?
Thanks in advance.