Win_Bulk_Zip_Extractor is a PowerShell script designed to simplify the process of extracting multiple ZIP archives in a given folder and its subfolders. The script leverages the [System.IO.Compression.ZipFile] class available in PowerShell 5.0 or higher to perform the extraction. If the required class is not available, the script falls back to using the Shell.Application COM object to achieve the same functionality.
- Extracts multiple ZIP archives in a folder and its subfolders.
- Utilizes [System.IO.Compression.ZipFile] for faster extraction (PowerShell 5.0 or higher).
- Falls back to Shell.Application COM object if [System.IO.Compression.ZipFile] is not available.
- Provides user interaction options for handling duplicate ZIP files.
- Displays a progress bar during the extraction process.
- PowerShell 5.0 or higher.
-
Clone or download the repository to your local machine.
-
Open a PowerShell terminal.
-
Change the directory to the location of the script file.
-
Run the script using the following command:
.\Win_Bulk_Zip_Extractor.ps1 -
The script will prompt you for the source folder path. Enter the path to the folder containing the ZIP archives you want to extract. If no input is provided, the default source folder is set to the current directory (.).
-
Next, the script will prompt you for the destination folder path. Enter the path where you want the extracted files to be stored. If no input is provided, the default destination folder is set to .\extracted.
-
The script will then process all the ZIP archives found in the source folder and its subfolders. It will extract the contents to the specified destination folder.
-
If the script encounters duplicate ZIP files in the destination folder, it will prompt you to choose an action:
- O: Overwrite the existing files.
- S: Skip the extraction for the current ZIP archive.
- R: Rename the current ZIP archive before extraction.
You can also choose to apply the selected action to all future duplicates.
During the extraction process, the script displays a progress bar indicating the progress of the extraction. The progress bar shows the percentage of completion for the entire extraction operation.
PS C:\Projects\Win_Bulk_Zip_Extractor> .\Win_Bulk_Zip_Extractor.ps1
Enter the source folder path (default: .\): C:\Projects\ZIP_Archives
Enter the destination folder path (default: .\extracted): C:\Projects\Extracted_Files
Confirmed PowerShell 5.V
[Duplicating Files ] archive1.zip 25.00% [==== ] 1/4
[Extracting ] archive2.zip 50.00% [======== ] 2/4
[Skipping Extraction ] archive3.zip 75.00% [==========] 3/4
[Extracting & Overwriting (Fallback Shell)] archive4.zip 100.00% [==========] 4/4This project is licensed under the MIT License.
Contributions to the project are welcome. If you find any issues or have suggestions for improvements, feel free to create a pull request or submit an issue.
This script is provided as-is, without any warranty or guarantee of any kind. The author is not responsible for any damage caused by the usage of this script.
This script was created by https://github.com/KR34T1V and inspired by https://chat.openai.com/.
Thank you for using Win_Bulk_Zip_Extractor! If you have any questions or feedback, please don't hesitate to reach out. Happy extracting!
