Ventoy Forums
Sharing a code for creating "windows_injection.zip" - Printable Version

+- Ventoy Forums (https://forums.ventoy.net)
+-- Forum: Ventoy Plugin (https://forums.ventoy.net/forumdisplay.php?fid=3)
+--- Forum: Ventoy Plugin Forum (https://forums.ventoy.net/forumdisplay.php?fid=4)
+--- Thread: Sharing a code for creating "windows_injection.zip" (/showthread.php?tid=1939)



Sharing a code for creating "windows_injection.zip" - Matthew Wai - 01-15-2022

https://github.com/ventoy/WinInjection/blob/main/WinInjection.zip

The above ZIP file contains the script "pack.bat", which uses 7-Zip to create "windows_injection.7z".
I have written the following code, which uses PowerShell to create "windows_injection.zip", which also works with Ventoy Injection Plugin. As PowerShell is a Windows built-in app, the third-party apps "7za32.exe" and "7za64.exe" are not needed. Just copy the following code into a CMD/batch script, which can then be used in place of "pack.bat". The "internal" folder, which contains the said third-party apps, can simply be deleted.

Code:
@echo off & CD /d "%~dp0" & Set "[ZIP]=windows_injection"
If exist "%[ZIP]%.zip" Del "%[ZIP]%.zip"
PowerShell Compress-Archive """X\*""" """%[ZIP]%"""
Mode con cols=72 lines=10 & color 17 & Echo.
Echo  ======================================================================
If exist "%~dp0%[ZIP]%.zip" (Echo.
Echo  The following file has been created in the current working directory.
Echo. & Echo  "%[ZIP]%.zip") else (Echo.
Echo  The operation has failed for some reason.)
Echo.
Echo  ======================================================================
Pause>nul