Extract archives with 7-zip

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
kiwichick
Posts: 676
Joined: 08 Aug 2012 04:14
Location: Windows 10 Pro 22H2, 150% scaling

Extract archives with 7-zip

Post 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.
Windows 10 Pro 22H2

highend
Posts: 14955
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Extract archives with 7-zip

Post 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
...
One of my scripts helped you out? Please donate via Paypal

kiwichick
Posts: 676
Joined: 08 Aug 2012 04:14
Location: Windows 10 Pro 22H2, 150% scaling

Re: Extract archives with 7-zip

Post by kiwichick »

Thanks highend, yet again!!! Yes I tried editing that other script but I obviously wasn't using the right bits :biggrin:
Windows 10 Pro 22H2

Post Reply