Date and Time

I have been using TCC since it was known as 4Dos. I have created aliases for adding files to a zipped file.

wz="c:\Program Files (x86)\Winzip\wzzip.exe"
zm=wz -m %1 %2 (where %1 is the name of the zipped file to create/use and the %2 are the files to add/move.)
zmt=wz -m %1 (I need code to add the date and time to %1) %2

I would like to make the alias create the zipped file with its name myfile071320111115.zip
Where the 07132011 is the date and the 1115 is the time.
I would like tcc to be able to do this without the need for me to do it manually like Ren myfile.* myfile071320111115.*

Any help would be appreciated.
 
Hallo harvey,


> I would like to make the alias create the zipped file with its name
> myfile071320111115.zip
> Where the 07132011 is the date and the 1115 is the time.

I'd prefer the format 20110713111508 (yyyymmddhhmmss) because then its
easy to sort the files chronoöogically, and adding seconds, your less
likely to end up with 2 identical names.

Best regards,

* Klaus Meinhard *
<www.4dos.info>
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,689
106
Albuquerque, NM
prospero.unm.edu
I have been using TCC since it was known as 4Dos. I have created aliases for adding files to a zipped file.
wz="c:\Program Files (x86)\Winzip\wzzip.exe"
zm=wz -m %1 %2 (where %1 is the name of the zipped file to create/use and the %2 are the files to add/move.)
zmt=wz -m %1 (I need code to add the date and time to %1) %2
I would like to make the alias create the zipped file with its name myfile071320111115.zip
Where the 07132011 is the date and the 1115 is the time.
I would like tcc to be able to do this without the need for me to do it manually like Ren myfile.* myfile071320111115.*

Any help would be appreciated.

Well, you could start with something like this:

Code:
alias zmt=`echo wz -m %@path[%1]%@name[%1]-%@format[02,%_month]%@format[02,%_day]%[_year]%@format[02,%_hour]%@format[02,%_minute].zip`

Test that, and if it gives the kind of filenames you want, remove the ECHO.
 

samintz

Scott Mintz
May 20, 2008
1,555
26
Solon, OH, USA
Just in case you missed it, the command
would use the variable _DATETIME to get the current date and time.

alias zmt=`wz -m %1%_DATETIME`

-Scott

Charles Dye <> wrote
on 07/15/2011 10:12:40 AM:


> Quote:
>
> Originally Posted by K_Meinhard [image removed]
> I'd prefer the format 20110713111508 (yyyymmddhhmmss)
because then

> its easy to sort the files chronoöogically, and adding seconds,
> your less likely to end up with 2 identical names.
>
> It's also somewhat easier to code....
>


>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> Charles Dye
>