I'm trying to use that DOS command to output a dir result to a text file. Is there any way to execute the command through in my C++ program?

If not, is there a way in C++ to get a list of all files in a directory?

Thanks!