Aytuğ123
Femtopat
- Katılım
- 3 Eylül 2023
- Mesajlar
- 6
Daha fazla
- Cinsiyet
- Erkek
Merhaba Kod :
#include <iostream>
#include <fstream>
#include <string>
#include <filesystem>
using namespace std;
namespace fs = std::filesystem;
int main()
{
string kaynakDosya = "yardimciKomut.exe";
string hedefDizin = "C:\\Windows\\System32"; // Çift ters eğik çizgi ile kaçış dizilerini kullanın
fs:
ath kaynakYolu = fs::current_path() / kaynakDosya;
fs:
ath hedefYolu = hedefDizin / kaynakDosya; // fs::current_path() kullanmanıza gerek yok
try {
fs::rename(kaynakYolu, hedefYolu);
cout << kaynakDosya << " dosyasi " << hedefDizin << " dizinine tasindi." << endl;
}
catch (const std::exception &e) {
cout << e.what() << endl;
}
return 0;
}
#include <iostream>
#include <fstream>
#include <string>
#include <filesystem>
using namespace std;
namespace fs = std::filesystem;
int main()
{
string kaynakDosya = "yardimciKomut.exe";
string hedefDizin = "C:\\Windows\\System32"; // Çift ters eğik çizgi ile kaçış dizilerini kullanın
fs:
fs:
try {
fs::rename(kaynakYolu, hedefYolu);
cout << kaynakDosya << " dosyasi " << hedefDizin << " dizinine tasindi." << endl;
}
catch (const std::exception &e) {
cout << e.what() << endl;
}
return 0;
}