Problème avec system("xcopy")
Bonjour,
Je suis en train de faire un programme dans lequel un Backup d'un dossier (ainsi que tout ce qu'il y a à l'intérieur) ont besoin d'être copier.
J'ai trouvé qu'avec :
Code:
1 2
| #include <Windows.h>
system("xcopy "source" "destination"") |
cela pouvait marché.
Dans mes chemin "source" et "destination" il y a des paramètres, mon code ressemble donc à sa :
Code:
1 2 3 4 5 6 7
| sprintf(copyBackup1,"xcopy /E /I /Y \"%s\" \"%s\"",pathConfig,pathDossierSaves4);
sprintf(copyBackup2,"xcopy /E /I /Y \"%s\" \"%s\"",pathItem,pathDossierSaves3);
sprintf(copyBackup3,"xcopy /E /I /Y \"%s\" \"%s\"",pathRemoteVdfTF2,pathDossierSaves2);
system(copyBackup1);
system(copyBackup2);
system(copyBackup3); |
Cependant quand j’exécute mon programme, j'ai cela au moment d'utiliser xcopy :
Citation:
'xcopy' n'est pas reconnu en tant que commande interne ou externe, un programme exécutable ou un fichier de commande
Et j'ai la même chose avec robocopy...
Quelqu'un aurait une solution svp ?
Cordialement,