Ich habe hier eine Klasse, die die Datei "unzip.exe" verwendet.
Die Datei ist Freeware
http://www.dpo.uab.edu/software/unzip/getunzipPC.htmlKann sein, dass das nicht der richtige Link ist; einfach mal bei Google suchen.
Zum Thema Unzip mit LS habe ich hier auch noch was
http://eknori.dyndns.org/knowledge/devidea.nsf/703257f00a483fb180256879002c0178/f28f099f53d9cf12802568e40037f9d0?OpenDocument&Highlight=0,unzipeknori
Type STARTUPINFO
cb As Long
lpReserved As String
lpDesktop As String
lpTitle As String
dwX As Long
dwY As Long
dwXSize As Long
dwYSize As Long
dwXCountChars As Long
dwYCountChars As Long
dwFillAttribute As Long
dwFlags As Long
wShowWindow As Integer
cbReserved2 As Integer
lpReserved2 As Long
hStdInput As Long
hStdOutput As Long
hStdError As Long
End Type
Type PROCESS_INFORMATION
hProcess As Long
hThread As Long
dwProcessID As Long
dwThreadID As Long
End Type
Declare Function WaitForSingleObject Lib "kernel32" (Byval hHandle As Long, Byval dwMilliseconds As Long) As Long
Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (Byval hwnd As Long, Byval lpOperation As String, Byval lpFile As String, Byval lpParameters As String, Byval lpDirectory As String, Byval nShowCmd As Long) As Long
Declare Function CreateProcessA Lib "kernel32" (Byval lpApplicationName As Long, Byval lpCommandLine As String, Byval lpProcessAttributes As Long, Byval lpThreadAttributes As Long, Byval bInheritHandles As Long, Byval dwCreationFlags As Long, _
Byval lpEnvironment As Long, Byval lpCurrentDirectory As Long, lpStartupInfo As STARTUPINFO, lpProcessInformation As PROCESS_INFORMATION) As Long
Declare Function CloseHandle Lib "kernel32" (Byval hObject As Long) As Long
'// Options for unzip.exe
'// for more options see the documentation of "unzip.exe"
Const QUIETMODE = " -qq " ' do not show messages
Const OVERWRITE = " -o " ' overwrite existing files
Const NEVER_OVERWRITE = " -n " ' never overwrite existing files
Const REFRESH = " -f " ' freshen existing file, create none
Const UPDATE = " -u " ' update files, create if necessary
Const ZIPINFO = " -Z -t " ' Summary of Zip-File
Const ZIPINFO_VERBOSE = " -Z -2 -t " ' Like ZIPINFO including FileNames
Const ZIPINFO_FILE = "~ZIPINFO.TMP" ' File containing ZIP-Informations
Const ZIPINFO_WZUNZIP = " -v "
Class UnzipFile
Private ExeFile As String
Private ExtractTo As String
Private FilesToExtract As String
Private UnzipOptions As String
Declare Public Sub New(UnzipExe As String, ExtractFilesTo As String)
Declare Private Function IsPathAvailable(path As String) As Variant
Declare Private Function IsDriveAvailable(drivNam$) As Variant
Declare Public Function Unzip(Files As String, Options As String)
Declare Public Function ZipInfo(Files As String)
Declare Private Sub ShellAndWait(Byval RunProg As String)
Declare Public Property Get Executable As String
Declare Public Property Set Executable As String
Declare Public Property Get TargetPath As String
Declare Public Property Set TargetPath As String
Sub New (UnzipExe As String, ExtractFilesTo As String)
'// Constructor
ExeFile = UnzipExe
dummy = IsPathAvailable(ExtractFilesTo)
ExtractTo = ExtractFilesTo
End Sub
Public Property Get Executable As String
Executable = ExeFile
End Property
Public Property Set Executable As String
ExeFile = Executable
End Property
Public Property Get TargetPath As String
TargetPath = ExtractTo
End Property
Public Property Set TargetPath As String
dummy = IsPathAvailable(TargetPath)
ExtractTo = TargetPath
End Property
Public Function Unzip(Files As String, Options As String)
'// Unzip Files
FilesToExtract = Files
UnzipOptions = Options
CommandStr = ExeFile & UnzipOptions & FilesToExtract & " -d " & ExtractTo
Call ShellAndWait(CommandStr)
End Function
Public Function ZipInfo(Files As String)
'// Unzip Files
FilesToExtract = Files
CommandStr = ExeFile & ZIPINFO_WZUNZIP & FilesToExtract & " > ZIPINFO"
Call ShellAndWait(CommandStr)
Msgbox ZIPINFO
End Function
Private Function IsDriveAvailable(drivNam$) As Variant
'// Test for existing drive and Path
'// if Path does not exist, create it
On Error Goto Errors
IsDriveAvailable = False
If Dir$(drivNam, 8) <> "" Then
IsDriveAvailable = True
End If
TheEnd:
Exit Function
Errors:
Resume TheEnd
End Function
Private Function IsPathAvailable(path As String) As Variant
'// Test, ob das Pfad vorhanden ist; wenn nicht, wird Pfad angelegt
Dim session As New NotesSession
Dim MyPath$, tmpPath$
Dim result%, pos%
On Error Resume Next
If IsDriveAvailable(Left(path,3)) Then
Chdrive Left( path, 1 )
Chdir path
result = False
pos = 1
If Curdir + "\" <> path Then
If Right( path, 1 ) <> "\" Then path = path + "\"
If path = "" Then Goto Exit_CheckDir
Chdrive Left( path, 1 )
Do While pos <> 0
pos = Instr( pos, path, "\" )
If pos > 0 Then
tmpPath = Left( path, pos-1 )
Mkdir tmpPath
Chdir tmpPath
pos = pos + 1
End If
Loop
If Curdir + "\" = path Then
result = True
End If
Else
result = True
End If
Else
End If
Exit_checkDir:
IsPathAvailable = result
Exit Function
End Function
Private Sub ShellAndWait(Byval RunProg As String)
Dim proc As PROCESS_INFORMATION
Dim StartInf As STARTUPINFO
StartInf.cb = Len(StartInf)
RetVal = CreateProcessA(0&, RunProg, 0&, 0&, 1&, NORMAL_PRIORITY_CLASS, 0&, 0&, StartInf, proc)
RetVal = WaitForSingleObject(proc.hProcess, INFINITE)
RetVal = CloseHandle(proc.hProcess)
End Sub
End Class