How to make a custom Zip button on XYplorer menu

Discuss and share scripts and script files...
Post Reply
alank
Posts: 4
Joined: 24 Jan 2011 17:27

How to make a custom Zip button on XYplorer menu

Post by alank »

I zip folders during the course of the day and use WinZip from the context menus to zip the folder using the folder name as the zip filename. The problem I have is that from WinZip, you can only zip one folder at a time in this manner. I would kill for method of selecting a group of folders and having a way to zip them all into separate files using the folder name as the respective zip filename.

Since this doesn't exist and I've not found any way to do this, I was wondering if there is a way to use a XYplorer script as a means to accomplish this. Then all I would have to do is select the folder or group of folders and click on a user button and have them zipped. I looked at the scripting language but couldn't find a way to do this. Can you help me to create a script or point me to something that was already done?

Thanks

zer0
Posts: 2676
Joined: 19 Jan 2009 20:11

Re: How to make a custom Zip button on XYplorer menu

Post by zer0 »

Do you need someone to write you such a script or give pointers so that you can attempt to do it yourself with a bit of guidance?
Reporting a bug? Have a wish? Got a question? Use search - View roadmap - FAQs: Forum + XY site
Windows 7/10
Always using the latest stable two-decimal build

admin
Site Admin
Posts: 66249
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: How to make a custom Zip button on XYplorer menu

Post by admin »

Here is a solution using UDCs (User Defined Commands) with WinZip. Here are the caption and the critical line to save you some typing:

Code: Select all

Add each selected item to separate archive (WinZip)
"winzip32" -a "Zipped_Folder_<base>.zip" <items>
UPDATE 1: add the -r switch to recurse subfolders:

Code: Select all

"winzip32" -a -r "Zipped_Folder_<base>.zip" <items>
UPDATE 2: with the latest BETA (v9.90.0101) you should use <title> instead of <base>:

Code: Select all

"winzip32" -a -r "Zipped_Folder_<title>.zip" <items>
Note the Mode setting (multiple instances!)!
UDCAddToSeparateZip.png
To trigger the UDC select menu User / Open With / Add each selected item to separate archive (WinZip).
To see the attached files, you need to log into the forum.

alank
Posts: 4
Joined: 24 Jan 2011 17:27

Re: How to make a custom Zip button on XYplorer menu

Post by alank »

The user deffined command works fine, however I want to run this from a menu button. Entering the same winzip32 statement in a script brings an error on the -a parameter.
Thanks

admin
Site Admin
Posts: 66249
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: How to make a custom Zip button on XYplorer menu

Post by admin »

alank wrote:The user deffined command works fine, however I want to run this from a menu button. Entering the same winzip32 statement in a script brings an error on the -a parameter.
Thanks
menu button?? You can create a User Button that calls this UDC. Is that what you mean?

admin
Site Admin
Posts: 66249
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: How to make a custom Zip button on XYplorer menu

Post by admin »

alank wrote:I would kill for method of selecting a group of folders and having a way to zip them all into separate files using the folder name as the respective zip filename.
Now, did you start the killing? I did not hear any screams yet...

alank
Posts: 4
Joined: 24 Jan 2011 17:27

Re: How to make a custom Zip button on XYplorer menu

Post by alank »

I'll have to take back what I said about having this working. I am using Winzip 15 which uses the command line aplication named wzzip.exe. Anyway the command line to zip folders is:
"wzzip.exe" -p -r (zip file name)
Using the statement "wzzip" -r -p "<base>.zip" does not work. I'm not shure what occurs since the screen flashes but this does work in a batch file.
Thanks

RalphM
Posts: 2089
Joined: 27 Jan 2005 23:38
Location: Cairns, Australia

Re: How to make a custom Zip button on XYplorer menu

Post by RalphM »

Maybe you should reread Don's post above, especially the 2nd edit and in general it helps to state OS and XY versions used to get the best help in this forum.
Ralph :)
(OS: W11 25H2 Home x64 - XY: Current x64 beta - Office 2024 64-bit - Display: 1920x1080 @ 125%)

alank
Posts: 4
Joined: 24 Jan 2011 17:27

Re: How to make a custom Zip button on XYplorer menu

Post by alank »

I'm using Windows 7, Winzip 15, XYplorer 9.5.

zer0
Posts: 2676
Joined: 19 Jan 2009 20:11

Re: How to make a custom Zip button on XYplorer menu

Post by zer0 »

alank wrote:I'm using Windows 7, Winzip 15, XYplorer 9.5.
You should be using at least v9.90.0101. Also, please take a look at how parameters are supposed to be used in that version of WinZip and bear in mind that single/double quotes make a big difference.
Reporting a bug? Have a wish? Got a question? Use search - View roadmap - FAQs: Forum + XY site
Windows 7/10
Always using the latest stable two-decimal build

Post Reply