Zip to 7zip or 7zip to zip

hello need help with a converter i have files that sometimes need to be .zip and sometimes the same files need to be .7z i would like a button to converter .7z to .zip and .zip to .7z any help would be great or if anyone knows of a tool to do this not online please... thanks

Zip to 7z:

@disablenosel:files,*.zip
@nofilenamequoting
@nodeselect
@set tempstamp {dateu|yyyyMMdd}_{timeu|HHmmss}
Copy "{filepath$}" EXTRACT To="/temp" CREATEFOLDER="{file$|noext}_{$tempstamp}"
Copy "/temp\{file$|noext}_{$tempstamp}\*" HERE ARCHIVE=.7z CREATEFOLDER="{file$|noext}"
Delete "/temp\{file$|noext}_{$tempstamp}" QUIET

7z to Zip:

@disablenosel:files,*.7z
@nofilenamequoting
@nodeselect
@set tempstamp {dateu|yyyyMMdd}_{timeu|HHmmss}
Copy "{filepath$}" EXTRACT To="/temp" CREATEFOLDER="{file$|noext}_{$tempstamp}"
Copy "/temp\{file$|noext}_{$tempstamp}\*" HERE ARCHIVE=.zip CREATEFOLDER="{file$|noext}"
Delete "/temp\{file$|noext}_{$tempstamp}" QUIET

Caveats:

  • Only handles the first archive, then stops.

I'm not sure why it stops, actually; I expected it not to, which would have had these caveats:

  • If you use it on multiple archives at once, it will extract all of them, then compress all of them, then delete the temp dirs. So it will use up more space than is really needed, due to the order it does things, and if one operation fails the rest will fail as well, and it will leave temp folders sitting around.

  • If you use this on multiple files at once, from Flat View or Find Results or similar, where two files may have the same name, it will probably go wrong and merge those two archives together.

A script could do things better to handle multiple files and take care of those situations, if it is needed, but I've kept things relatively simple for now.

trying to get this in dopus 13 when i paste all the text is on one line and the button is not working what changed in dopus 13?

It's not Opus 13. The way the forum software handles code blocks changed and broke a lot of old threads. I've fixed the post above.

1 Like

I just tried it and works some what . stops after first zip to 7zip..
might be better to have folders to 7zip and folders to zip buttons

i have this one for zip Copy ZIP=single HERE

now i need for folder to 7zip

Here's a similar solution that converts multiple selected archives:

https://resource.dopus.com/t/how-to-convert-a-zip-to-a-7z-in-a-single-button/42756/2

Not a lot of error checking, either :slight_smile:

Thank you Leo the linked one worked .. i did search Zip to 7zip :grinning: