0
I have a project in Delphi 2010 in which I use to compress and create backups Winrar, through the following code I can compress the following folder teste3
:
AFile := 'C:\teste1\teste2\teste3';
LocateFile := 'C:\Users\Desktop\BACKUPS\'+ FormatDateTime('yyyy-mm-dd', Now) +'.rar';
winexec(PAnsiChar(AnsiString('"C:\Program Files\WinRAR\WinRAR.exe" a '+ LocateFile +' "'+ AFile + '"')), SW_HIDE);
But the compressed file is not showing as intended with the folder only teste3
I leave here the example of what I want.
This is the directory of the folder teste3
:
C: teste1 teste2 teste3
Structure:
c:
teste1
teste2
teste3
exemplo1.txt
exemplo2.txt
exemplo3.txt
ficheiro1.txt
ficheiro1.txt
When compressed inside the .rar
have:
ficheiro.rar
teste1
teste2
teste3
exemplo1.txt
exemplo2.txt
exemplo3.txt
What do I want:
ficheiro.rar
teste3
exemplo1.txt
exemplo2.txt
exemplo3.txt
If anyone can contribute anything thank you.
see this http://www.swissdelphicenter.ch/en/showcode.php?id=2413 http://docwiki.embarcadero.com/CodeExamples/Berlin/en/DirectoryOperations_(Delphi)
– Pablo Tondolo de Vargas
maybe I did not explain myself well in the question, but those two folders have files inside them, but when I compress the folder "teste3" that is inside them they are also compressed things that I did not want and without files
– Tmc
I have already made an adjustment to my question to try to be more explicit what I need
– Tmc