Frage: Wie kann ich alle Dateien "7-Zip und Zip" eines Ordners mit dem Programm 7Zip entpacken?
Wir nutzen das Kommandozeilentool des Programmes 7Zip. Eine Installation ist nicht erforderlich.
Um mein Beispiel zu nutzen MÜSSEN Sie die Pfade anpassen! Im Modul2 ist ein Beispiel, wie eine Passwortgeschützte Datei entpackt wird. Siehe zweiten Download.
INFO: Bitte denken Sie daran, dass Sie im zweiten Download nur den Code in Modul 2 testen. Wenn Sie den Code aus Modul1 starten bleibt "7za.exe" im Hintergrund offen, da er auf die Eingabe des Passwortes wartet. Das Fenster ist aber ausgeblendet. :-)
Please remember that you only test the code in module 2 in the second download. When you start the code in Module1 remains open "7za.exe" in the background, as he waits for the input of the password. But the window is hidden. :-)
How can I extract all files "7-Zip and Zip" in a folder with the 7Zip program?
We use the command line tool of the program 7Zip. No installation is required.
To use my example you MUST adjust the paths! In Modul2 is an example of how a Password-protected file is extracted. See second download.
Hier noch eine Beispieldatei / Here's a sample file:
ZIP - mit 7Zip alle Dateien "7-Zip und Zip" eines Ordners entpacken...[ZIP 4 MB]
Hier noch eine Beispieldatei mit Passwort / Here is a sample file with a password:
ZIP - mit 7Zip eine Datei "7-Zip" mit Passwort entpacken...[ZIP 5 MB]
Link:
7Zip...
7Zip - Download...
Wir nutzen das Kommandozeilentool des Programmes 7Zip. Eine Installation ist nicht erforderlich.
Um mein Beispiel zu nutzen MÜSSEN Sie die Pfade anpassen! Im Modul2 ist ein Beispiel, wie eine Passwortgeschützte Datei entpackt wird. Siehe zweiten Download.
INFO: Bitte denken Sie daran, dass Sie im zweiten Download nur den Code in Modul 2 testen. Wenn Sie den Code aus Modul1 starten bleibt "7za.exe" im Hintergrund offen, da er auf die Eingabe des Passwortes wartet. Das Fenster ist aber ausgeblendet. :-)
Please remember that you only test the code in module 2 in the second download. When you start the code in Module1 remains open "7za.exe" in the background, as he waits for the input of the password. But the window is hidden. :-)
How can I extract all files "7-Zip and Zip" in a folder with the 7Zip program?
We use the command line tool of the program 7Zip. No installation is required.
To use my example you MUST adjust the paths! In Modul2 is an example of how a Password-protected file is extracted. See second download.
Hier noch eine Beispieldatei / Here's a sample file:
ZIP - mit 7Zip alle Dateien "7-Zip und Zip" eines Ordners entpacken...[ZIP 4 MB]
Hier noch eine Beispieldatei mit Passwort / Here is a sample file with a password:
ZIP - mit 7Zip eine Datei "7-Zip" mit Passwort entpacken...[ZIP 5 MB]
Link:
7Zip...
7Zip - Download...
OptionExplicit
' Konstante für die KONSOLENANWENDUNG 7Zip
' Keine Installation erforderlich
' Pfade ANPASSEN!!!!!!!!
ConststrZipAsString="C:\Temp\Zip\7za.exe"
' Pfad in dem die 7z-Dateien UND Zip-Dateien sind
ConststrPathQAsString="C:\Temp\Zip\"
' Pfad in den die 7z-Dateien UND Zip-Dateien
' gegebenenfalls entpackt werden sollen
ConststrPathZAsString="C:\Temp\Zip\Neu\"
'--------------------------------------------------------------------------
' Module : Modul1
' Author : Case (Ralf Stolzenburg)
' Date : 14.08.2013
' Purpose : 7-Zip alle Dateien (7z und Zip) eines Ordners entpacken...
'--------------------------------------------------------------------------
PublicSubMain()
DimstrFileNameAsString
DimstrArgAsString
OnErrorGoToFin
strFileName=Dir$(strPathQ&"*.*z*")
' Schleife über alle 7z- UND Zip-Dateien
DoWhilestrFileName<>""
' Entpackt alle 7z-Dateien UND Zip-Dateien in den angegebenen Ordner
strArg=strZip&" x "&strPathQ&strFileName&" -y -o"&strPathZ
' Entpackt alle 7z-Dateien UND Zip-Dateien in den aktuellen Ordner
'strArg = strZip & " e " & strPathQ & strFileName & " -y"
' Entpackt alle 7z-Dateien UND Zip-Dateien in den aktuellen Ordner -
' jede 7z-Datei in einen Ordner. Entspricht 7-Zip - Entpacken nach "*\"
' Der aktuelle Ordner (CurDir) kann auch vorher noch eingestellt werden
' -y bedeutet KEINE Nachfrage, wenn Dateien schon vorhanden sind
'strArg = strZip & " x " & strPathQ & strFileName & " -y -o*"
' Warten bis entpacken erledigt ist
ShellAndWaitstrArg
' Nächster Dateiname
strFileName=Dir$()
Loop
Fin:
' Wenn die Fehlernummer NICHT 0 ist, dann gib die Fehlernummer
' und die Fehlerbeschreibung aus
IfErr.Number<>0ThenMsgBox"Fehler: "&_
Err.Number&" "&Err.Description
EndSub
'--------------------------------------------------------------------------
' Module : Modul1
' Procedure : ShellAndWait
' Author : Case (Ralf Stolzenburg)
' Date : 14.08.2013
' Purpose : ShellAndWait mit ausgeblendetem Dosfenster...
'--------------------------------------------------------------------------
PrivateSubShellAndWait(ByValstrPathNameAsString)
DimWshShellAsObject
OnErrorGoToFin
SetWshShell=CreateObject("WScript.Shell")
WshShell.RunstrPathName,0,True
Fin:
SetWshShell=Nothing
IfErr.Number<>0ThenMsgBox"Error: "&_
Err.Number&" "&Err.Description
EndSub
OptionExplicit
' Konstante für die KONSOLENANWENDUNG 7Zip
' Keine Installation erforderlich
' Pfade ANPASSEN!!!!!!!!
ConststrZipAsString="C:\Temp\Zip\7za.exe"
' Pfad in den die 7z-Dateien UND Zip-Dateien
' gegebenenfalls entpackt werden sollen
ConststrPathZAsString="C:\Temp\Zip\Neu\"
'--------------------------------------------------------------------------
' Module : Modul1
' Author : Case (Ralf Stolzenburg)
' Date : 14.08.2013
' Purpose : 7-Zip alle Dateien (7z und Zip) eines Ordners entpacken...
'--------------------------------------------------------------------------
PublicSubMain_1()
DimstrFileNameAsString
DimstrArgAsString
OnErrorGoToFin
' Pfad- und Dateiname gegebenenfalls anpassen!!!!!
strFileName="C:\Temp\Zip\Kira7_Password_is_HIDE.7z"
' Eine PASSSWORTgeschützte 7Zip-Datei entpacken. Passwort ist HIDE
strArg=strZip&" e -pHIDE "&strFileName&" -y -o"&strPathZ
ShellAndWaitstrArg
Fin:
' Wenn die Fehlernummer NICHT 0 ist, dann gib die Fehlernummer
' und die Fehlerbeschreibung aus
IfErr.Number<>0ThenMsgBox"Fehler: "&_
Err.Number&" "&Err.Description
EndSub
'--------------------------------------------------------------------------
' Module : Modul2
' Procedure : ShellAndWait
' Author : Case (Ralf Stolzenburg)
' Date : 14.08.2013
' Purpose : ShellAndWait mit ausgeblendetem Dosfenster...
'--------------------------------------------------------------------------
PrivateSubShellAndWait(ByValstrPathNameAsString)
DimWshShellAsObject
OnErrorGoToFin
SetWshShell=CreateObject("WScript.Shell")
WshShell.RunstrPathName,0,True
Fin:
SetWshShell=Nothing
IfErr.Number<>0ThenMsgBox"Error: "&_
Err.Number&" "&Err.Description
EndSub