Page 1 of 1

Extract archives with 7-zip

Posted: 19 Sep 2012 06:15
by kiwichick
Hi there, I am doing my own head in here :veryconfused: I just cannot get the 7z.exe 'extract' command to work. On selected archives I want to do any of the following:

1. Extract here
2. Extract here to folder with 'archivename'
3. Extract at defined location
4. Extract at defined location to folder with 'archivename'

Cheers.

Re: Extract archives with 7-zip

Posted: 19 Sep 2012 08:42
by highend

Code: Select all

"Extract here"
	run """D:\Users\Highend\Downloads\7za920\7za.exe"" x ""<curitem>"" -y", , 2;

"Extract to <archivename>"
	$baseName = getpathcomponent("<curitem>", "base");
	run """D:\Users\Highend\Downloads\7za920\7za.exe"" x ""<curitem>"" -o""$baseName"" -y", , 2;

"Extract to <xxx>"
	run """D:\Users\Highend\Downloads\7za920\7za.exe"" x ""<curitem>"" -o""C:\Temp"" -y", , 2;

"Extract to <xxx>\<archivename>"
	$baseName = getpathcomponent("<curitem>", "base");
	run """D:\Users\Highend\Downloads\7za920\7za.exe"" x ""<curitem>"" -o""C:\Temp\$baseName"" -y", , 2;
It's just derived from:
http://www.xyplorer.com/xyfc/viewtopic.php?f=3&t=8588
...

Re: Extract archives with 7-zip

Posted: 19 Sep 2012 09:07
by kiwichick
Thanks highend, yet again!!! Yes I tried editing that other script but I obviously wasn't using the right bits :biggrin: