Nov 13, 2016 at 10:06am
I simply want my program to go in a directory of my choice and i can't find the answer anywhere to such a simple question.
Why is this not working ?
Can i just write commands in the command prompt simply using a function ?
using windows10/visual studio 2015
when i run this i have the dir of where the program is instead of c:\msi
1 2 3 4 5 6 7 8 9 10 11
|
int main()
{
system("cd C:\MSI");
system("dir");
char pause;
cin >> pause;
return 0;
}
|
Last edited on Nov 13, 2016 at 10:07am
Nov 13, 2016 at 11:55am
You need to use a double backslash system("cd C:\\MSI");