Page 1 of 1

Add Date and Time to archive name in pack option

Posted: 2025-04-10, 07:03 UTC
by hoegge
Long time user of TC (decades). One thing I would really like to see that would be very useful, would be the having an option in the pack dialog to enable adding date and time at the end of the file name, so instead of a name like

c:\temp\files.zip

you get

c:\temp\files 2025-04-01 10:32:31.zip

and really greate if the could be a text field next to the option where you could define your own time format. yyyy-MM-dd hh:mm:ss

that it remembers including the option check box state so you can keep it on.

Use case: saving new versions of files and folders compressed without having to rename them every time and add date info.

Thanks.

Re: Add Date and Time to archive name in pack option

Posted: 2025-04-10, 07:57 UTC
by Horst.Epp
Make a button like this and adapt it for your needs.

Code: Select all

TOTALCMD#BAR#DATA
cm_packfiles
/G /E="7-ZIP"  /T="%T%B_%|$DATE:YMD_hm|.7z"
wcmicons.dll,30
Pack selected as 7z to target with name of current dir


-1

Re: Add Date and Time to archive name in pack option

Posted: 2025-04-10, 08:39 UTC
by Dalai
2hoegge
A colon is not a valid character to use in filenames. Not only that, it's used to separate NTFS alternate data streams (ADS) from the filename, and everything following the colon is the ADS name.

Re: Add Date and Time to archive name in pack option

Posted: 2025-04-10, 12:48 UTC
by hoegge
Thanks .. was not aware the cm_pack could take arguments - thanks - and works with internal compressor too, so have ended up using this line, where the source filename or folder name is used:

/G /E="ZIP" /T="%T%O %|$DATE:Y-M-D h.m.s|.zip"

Thanks horst.epp

/Hoegge