Help with 7za.exe Commandline example


I need help to succeed in this commandline with 7az.exe where I want extract a TestFile.7z, to a directory %temp%. (or any other directory).

But simply extract doesn’t work for me

## Extract 7TestFile.7z
Execute-Process -path "$dirFiles\7za.exe"  -addParameters 'x,TestFile.7z'


Self extracting archives - sfx are very useful for this. Instead of a 7z or zip or other formats you will get an .exe so you can run it with a specified path. I suggest this as an alternative to your problem solution.

If you need to have a 7z file you still need an application that extract it. I dont know exact parameters for 7za though. Can you post them here so we can assist you?

Thank you Luke412,

It was trial&error but I’ve got it now:

-addParameter doesn’t work here:

[Installation] :: Error Record:
Message        : A parameter cannot be found that matches parameter name 'addParameters'

This is a working entry where: x=extract files with full paths, -o=outputdirectory, -y=assume Yes on all queries.
It will create a %temp% and extract the content of the TestZipFile folder. Directory %temp% is in the same folder where 7za.exe is located.

Execute-Process -path "$dirFiles\7za.exe"  -Parameters 'x TestZipFile.7z -o%temp% -y'


Changed the titel for better search

Very similar to above is what we use.

Execute-Process -Path “$envProgramFiles\7-Zip\7z.exe” -Parameters ‘x C:\Support\ -oC:\EXTRACTFOLDERNAME -y’ -WindowStyle ‘Hidden’