Wav3 Posted July 10, 2014 Report Posted July 10, 2014 Functiile de baza pentru crearea si extragerea unei archive .rar sau .zip.Creare arhiva :Public Function WArchive(FileOrFolderPath As String, DestinationArchivePath As String, Optional Level As Integer = 3, Optional ReplaceAlreadyExistingArchive As Boolean = False, Optional Password As String, Optional EncryptFileNames As Boolean = True) As BooleanIf Not Password = vbNullString Then If EncryptFileNames = True Then Password = " " & Chr(34) & "-hp" & Password & Chr(34) Else Password = " " & Chr(34) & "-p" & Password & Chr(34) End IfEnd IfIf ReplaceAlreadyExistingArchive = True And Dir(DestinationArchivePath) <> vbNullString Then Kill DestinationArchivePathWArchive = ShellWait(Environ("programfiles") & "\WinRAR\WinRar.exe a -m" & Level & " " & Chr(34) & DestinationArchivePath & Chr(34) & Password & " " & Chr(34) & FileOrFolderPath & Chr(34), False)End FunctionExtragere din arhiva :Public Function WExtract(ArchivePath As String, DestinationPath As String, Optional KeepFolderStructure As Boolean = True, Optional Password As String) As BooleanIf Not Password = vbNullString Then Password = " " & Chr(34) & "-p" & Password & Chr(34)If KeepFolderStructure = True Then WExtract = ShellWait(Environ("programfiles") & "\WinRAR\WinRar.exe x " & Chr(34) & ArchivePath & Chr(34) & Password & " " & Chr(34) & DestinationPath & Chr(34), False)Else WExtract = ShellWait(Environ("programfiles") & "\WinRAR\WinRar.exe e " & Chr(34) & ArchivePath & Chr(34) & Password & " " & Chr(34) & DestinationPath & Chr(34), False)End IfEnd FunctionDownload : GirlShare - Download WinrarCommands.rarProiectul mai contine o functie ShellWait al carui cod nu imi apartine. Quote