Page 1 of 1

How to make a custom Zip button on XYplorer menu

Posted: 24 Jan 2011 17:30
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

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

Posted: 24 Jan 2011 18:40
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?

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

Posted: 24 Jan 2011 19:44
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).

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

Posted: 25 Jan 2011 21:10
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

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

Posted: 26 Jan 2011 10:46
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?

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

Posted: 31 Jan 2011 14:19
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...

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

Posted: 01 Feb 2011 22:13
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

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

Posted: 01 Feb 2011 22:21
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.

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

Posted: 08 Feb 2011 21:39
by alank
I'm using Windows 7, Winzip 15, XYplorer 9.5.

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

Posted: 09 Feb 2011 13:06
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.