0
私は現在、ネットワークデバイスのrobocopyバックアップを支援するための小さなプログラムを作成しようとしているC++の初心者です。これまでのところ、私は以下のコードを思いつきましたが、ユーザー定義の入力を伴うC++ Robocopy
が31「『ROBOCOPY //』 < < OLDNAME」私はrobocopyをを使用して、すべての行に対して繰り返し同じエラーを取得し
で「演算子< <」の一致、任意のヘルプはないだろう:次のエラーを取得します大いに感謝します。始まるのおかげで、すべての
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
string oldname;
string newname;
string userid;
char response;
cout<<"Please input old device name eg XXXXXX\n";
cin>> oldname;
cout<<"Please input new device name eg XXXXXX\n";
cin>> newname;
cout<<"Please input userid eg SP12345\n";
cin>> userid;
cout<<"Does your current device contain a D: drive? Y or N?";
cin>> response;
if (response == 'Y')
{
std::system("ROBOCOPY //"<<oldname<<"/c$/Users/"<<userid<<"/Desktop //"<<newname<<"/C$/Users/"<<userid<<"/Desktop /MIR /w:0 /r:0");
std::system("ROBOCOPY //"<<oldname<<"/c$/Users/"<<userid<<"/Favorites //"<<newname<<"/C$/Users/"<<userid<<"/Favorites /MIR /w:0 /r:0");
std::system("ROBOCOPY //"<<oldname<<"/c$/Users/"<<userid<<"/My Documents //"<<newname<<"/C$/Users/"<<userid<<"/My Documents /MIR /w:0 /r:0");
std::system("ROBOCOPY //"<<oldname<<"/d$ //"<<newname<<"/C$/Users/"<<userid<<"/Desktop/D backup /MIR /w:0 /r:0";
}
else if (response == 'N')
{
std::system("ROBOCOPY //"<<oldname<<"/c$/Users/"<<userid<<"/Desktop //"<<newname<<"/C$/Users/"<<userid<<"/Desktop /MIR /w:0 /r:0;
std::system("ROBOCOPY //"<<oldname<<"/c$/Users/"<<userid<<"/Favorites //"<<newname<<"/C$/Users/"<<userid<<"/Favorites /MIR /w:0 /r:0;
std::system("ROBOCOPY //"<<oldname<<"/c$/Users/"<<userid<<"/My Documents //"<<newname<<"/C$/Users/"<<userid<<"/My Documents /MIR /w:0 /r:0;
}
system("pause");
}