UDC command help

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
eurytos
Posts: 200
Joined: 29 Jan 2008 15:53

UDC command help

Post by eurytos »

Ok,

with all the discussion going on I had to setup something of my own but I ran into a snag of sorts...

my command is:
"C:\Program Files\7-Zip\7z.exe" x -y -o"<curbase>" <items>

The command will create a folder in my current location that has the same name as the selected item and then extract all the files into it. This part works just how I want it.

now, if I select more than one item I get two results
a - If I have 'single instance' selected nothing happens

b - If I have 'multiple instance' selected it will create one folder based on one of the selected item names (last or first I would guess) and then extract all the files from the multiple zip files into that folder.

for those not familiar with 7-zip:
x = extract all with subdirectories
-y = overwrite without prompting
-o = output directory

jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Post by jacky »

Well, the thing is that for such case there's usually two options :

- using single instance mode, which is the best because your app can handle at archive after the other and deals with all folders' names on its own. But, it requires to support multiple files as input, as well as an option to extract each into its own folder. For example, WinRAR does this with -ad

- multiple instance mode, so your app is called once for every file. But, it means it will probably try to extract all archives at once, which usually isn't a good idea as one after the other is much faster. But, like before, it requires an option to create a folder by the name of the archive, since your script can't send it - as it will always be the same one. (Though there should be a way to bypass such limitations later, when a script will be able to loop through each (selected) List item.)

I don't know 7z so I can't really help you, more than to say that you'll have to find an option in 7z so that it can create/extract to a folder named after the archive's name (instead of you having to actually specify it)
Proud XYplorer Fanatic

eurytos
Posts: 200
Joined: 29 Jan 2008 15:53

Post by eurytos »

Thanks Jacky!

Well after some scrounging around and searching through some forums I found the answer.. IMO their documentation is poor in terms of this. It mentioned the '*' as a wildcard but I didn't come across anything relating it to folder creation based on archive. Oh well

"C:\Program Files\7-Zip\7z.exe" x -y -o* <items>

* meh!

gives me the results I was looking for. Well sort-of... It doesn't work in single instance mode but for right now I am happy with it.

Post Reply