Convert a zip file to a 7z file and Move the 7z to the Destination

Convert a zip file to a 7z file and Move it to the Destination

I am trying to convert a zip file in the left pane of a dual lister to a 7z file and move the converted file to the destination in the right pane of the dual lister.

The commands are:

Copy FILE="{file}" EXTRACT=sub HERE CREATEFOLDER="Temp {file|noext} zzz"
Copy FILE="{sourcepath}Temp {file|noext} zzz\*" ARCHIVE=.7z TO="{sourcepath}"
Delete FILE="Temp*zzz" QUIET
Delete FILE QUIET
Select {file|noext}.7z EXACT
Copy Move

The Copy Move fails with the error "Source and destination must be different to move files."

A .7z file is created and selected.

Using F:\DOpus\dopusrt.exe /cmd Copy Move instead of Copy Move gives the same error.

I don't understand how source and destination can ever be the same in a dual lister.

How can I get the Copy Move to work? Thanks.

(See Formatting tips specific to the Opus forum for tips to avoid the forum mangling code containing backslashes and asterisks. I've edited the root post to fix things.)

Avoid the HERE argument in any button that runs more than one Copy command, as it can change what the button's destination is in subsequent commands.

Try this, which will create the archive in the destination directly:

@nofilenamequoting
Copy FILE="{file$}" EXTRACT=sub TO="{sourcepath$}" CREATEFOLDER="Temp {file$|noext} zzz"
Copy FILE="{sourcepath$}Temp {file|noext} zzz\*" ARCHIVE=.7z TO="{destpath$}"
Delete FILE="Temp {file$|noext} zzz" QUIET
Delete FILE="{file$}" QUIET

Or this, if you want to create it in the source first before moving it to the destination like you were doing:

(e.g. Can be better for a slow destination. Or to get an overwrite prompt if the archive already exists, instead of merging the new contents into the old archive.)

@nofilenamequoting
@set ArcName={file$|noext}
Copy EXTRACT=sub TO="{sourcepath$}" CREATEFOLDER="Temp {$ArcName} zzz"
Copy FILE="{sourcepath$}Temp {$ArcName} zzz\*" ARCHIVE=.7z TO="{sourcepath$}"
Delete FILE="Temp {$ArcName} zzz" QUIET
Delete FILE="{filepath$}" QUIET
Copy FILE="{$ArcName}.7z" MOVE TO="{destpath$}"

Leo,

Thank you! The commands solved the issue and gave several examples of how to code for various goals.

1 Like