I need to use xcopy here (since I don't know a better way). My question is, how do I need to format the line with system() so that the compiler can read it. I'm using GNU GCC with CodeBlocks.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
int main()
{
// Need to identify two strings that will be used to take user input to pull
// the correct files from the computer
string driveLetter;
string userName;
cout << "What is the drive letter of your external?" << endl;
cin >> driveLetter;
cout << "What is the user ID of the profile you want to copy?" << endl;
cin >> userName;
//The neccessary variables have been set and now copying can begin
system("xcopy" C:\Documents and Settings\%userName%\My Documents %DriveLetter%:\USERS\%userName%\Documents)
Originally this whole this came from a batch file. I just wanted to try to implement it into c++ just to have one more thing to learn, though I found myself rather stuck.