probleme avec la fonction rename
bonjour a tous,
voila j'ai un probleme avec un fichier dont je veux changer le nom , il se trouve dans le dossier démarrer , voici le code
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <dirent.h>
#include <string.h>
#include <fstream>
#include <windows.h>
#include <time.h>
#include <winsock.h>
#include <mysql.h>
#include <MYSQL/mysql.h>
using namespace std;
int main()
{
[extrait du code retiré ]
sprintf(path6,"C:\\Users\\%s\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\coco.exe",chemin1);
copie1=fopen(path6,"r");
if(copie1){
rename(path6,"C:\\Users\\%s\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\jeu.exe");
fclose(copie1);
}
} |
le probleme c'est que ca ne renomme pas le fichier.exe,
avez vous une idée?
merci.