Hello! There is a program that first unzips the bz2 archive, and then performs the necessary actions on it. Arkhir is placed in the folder_for_arhiv directory. Unzipped and renamed to .txt permission. In Windows XP, everything works well, and after unarchiving, Windows 7 renames all files in the folder, adding .txt, and does not enter the folder_for_arhiv folder and does not touch the file from the archive. A piece of code:
int f; AnsiString Path = "folder_for_arhiv\\*.bz2"; AnsiString zx; AnsiString zx2; TSearchRec sr; int done = FindFirst( Path, faAnyFile, sr ); while(!done) { s->Add(sr.Name); done = FindNext(sr); } FindClose(sr); for(int i=0;i<s->Count;i++) { //ΠΡΠΎΡ
ΠΎΠ΄ΠΈΠΌΡΡ ΡΠΈΠΊΠ»ΠΎΠΌ ΠΏΠΎ Π²ΡΠ΅ΠΌΡ ΡΠΏΠΈΡΠΊ zx = zx + "folder_for_arhiv\\" + s -> Strings[i] + " "; zx2 = zx2 + s -> Strings[i] + " "; } zx = "bunzip2.exe " + zx; s -> Clear(); zx2 = zx + "\ncd /folder_for_arhiv \nren *.* **.txt"; f = FileCreate("C:\\sss.bat"); FileWrite(f,zx2.c_str(),zx2.Length()); FileClose(f); WinExec("C:\\sss.bat",SW_SHOW);
The problem is that it does not perceive this line when executing a BAT file:
zx2 = zx + "\ncd /folder_for_arhiv \nren *.* **.txt";
In XP, everything works fine. After unpacking, a file is obtained without an extension, with the help of this line in XP it goes to the folder_for_arhiv directory and adds it to the end of the .txt file
How to remake to work in Windows 7?