Create Zip from and exe but rename the exe before adding to archive

hi long time user, first time poster. hope everyone is well.

i need a little help with a command i'm trying to build please.

im trying to create a new zip file with an exe inside it but i want to rename the exe before adding it to the archive, i've tried using the {file} moniker but this gives me the suffix too so i get "renamethisfile.exe.zip"

Copy AS "//X:\_v6\branding\_INNO\output\renamethisfile.exe" ADDTOARCHIVE CREATEFOLDER"//X:\_v6\branding\_INNO\output\{file}"

also i get a prompt from DOPUS to name the file upon creation... how can i make this automated (no prompt) please?

thank you!

Maybe it was just editing for the forum but that command doesn't look right. The "//" before the drive letters shouldn't be there, and there should be a space after CREATEFOLDER.

i want to rename the exe before adding it to the archive

The AS argument can do that, if you mean you want to change the name the exe file will have inside the archive.

(If you just mean changing the extension of the archive itself, you're already on the right track with that and don't need any extra arguments.)

i've tried using the {file} moniker but this gives me the suffix too so i get "renamethisfile.exe.zip"

You can use {file|ext=zip} to change the extension to .zip.

also i get a prompt from DOPUS to name the file upon creation... how can i make this automated (no prompt) please?

Use ARCHIVE (creates/updates the archive without prompting) instead of ADDTOARCHIVE (displays the Add To Archive dialog).

HI Leo Many thanks for the swift reply,

i want to rename the exe before adding it to the archive

sorry i want to change the filename not the suffix/extension

Can you give an example of exactly what you want to do?

I want to rename OldName.exe before adding to a zip file of the same new name

oldname.exe

newname.zip/newname.exe

thank you! :slight_smile:

Try

Copy ARCHIVE FILE=D:\oldname.exe AS=newname.exe TO=D:\ CREATEFOLDER=newname

Admittedly, a bit bland. Spice it up with codes!

https://www.gpsoft.com.au/help/opus12/index.html#!Documents/External_control_codes.htm

1 Like

Many thanks guys! sorted it :slight_smile: