Literal Space in system()

I need the program to create a folder inside of C:\Program Files. I tried typing system("MKDIR C:\\Program Files\\FILENAME") but it ends up creating a folder called "Program" on the C: drive. It's reading the space between Program and Files as the end of the file name. How to i force it to recognize it as a space? This is written in C++ using Dev-C++
You probably need to embed double quotes in your MKDIR command.

To make this directory from the command prompt you would have to type

mkdir "C:\Program Files\FILENAME"

with double quotes.

Try

 
system( "MKDIR \"C:\\Program Files\\FILENAME\"" );

Yep, that worked. thanks!
Topic archived. No new replies allowed.