Skip to content
Homes32 edited this page May 14, 2022 · 1 revision

7z

Execute 7zip with the provided arguments.

This command is a wrapper for 7z.exe and passes any arguments directly to the executable. Generally speaking PEBakery's builtin Decompress command works best for archives, such as 7z/zip/rar/etc. however extracting from self-extracting .exe and installers such as NSIS don't work. Use the 7z command to extract these files directly with 7zip.

Syntax

7z,<Args>[,<WorkDir>]

Arguments

Argument Description
Args The arguments to pass to the 7z executable.
WorkDir The full path to the working directory. Default is the exe path.

Return Codes

Variable Description
#r ExitCode provided by the 7zip application.

Remarks

Make sure to escape double-quotes, percent, etc. in Args.

See the 7zip documentation for more details on 7z.exe arguments.

Related

Examples

Example 1


Echo,"Extracting %ScriptTitle%..."
7z,"e -y -r- #$q%ProgramsCache%\%ProgramFolder%\WinPE.zip#$q Files\auto_reactivate64.bin Files\bootwiz64.efi -o#$q%TargetPrograms%\%ProgramFolder%\#$q"
If,Not,#r,Equal,0,Halt,"Error: Failed to extract [WinPE.zip]."