Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <windows.h>
- using namespace std;
- int main()
- {
- ifstream bat;
- char text[999999];
- bat.open("AndroidProgrammierung.bat");
- if(bat.is_open())
- for(int i=0; !bat.eof(); i++){
- text[i]=bat.get();
- }
- bat.close();
- char path[]="A:\\Informatik\\Dokumentation.htm";
- char output[]="dir /-C A: >test.txt";
- ifstream check;
- for(int i=0; i<26; i++){
- system(output);
- int filesize;
- ifstream control;
- control.open("test.txt");
- if(control.is_open())
- {
- int start=control.tellg();
- control.seekg(0, ios::end);
- int end=control.tellg();
- filesize=end-start;
- control.close();
- }
- if(filesize>0)
- check.open(path);
- if(check.is_open()){
- break;
- check.close();
- }
- path[0]++;
- output[8]++;
- }
- for(int i=0; i<999999; i++){
- if(text[i]==':' && text[i+1]=='\\')
- text[i-1]=path[0];
- }
- ofstream txt;
- txt.open("AndroidProgrammierung.bat", ios::trunc);
- if(txt.is_open())
- for(int i=0; text[i]!='ÿ'; i++)
- txt << text[i];
- txt.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement