How to copy a file and rename with timestamp ?

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Miamigo

How to copy a file and rename with timestamp ?

Post by Miamigo » Mon Nov 10, 2003 4:36 pm

I want to copy a file; L:\dos\miamigo.txt to a local disk and add timestamp to the file name;
C:\_dos\miamigo20031110190103.txt and the next copy of the same file will get a new "timestamped" named.
Is this possible ?

Lumumba

Post by Lumumba » Tue Nov 11, 2003 7:15 am

Yes.

Code: Select all

Year>YYYY
Month>MM
Day>DD
Hour>HH
Min>MM
Sec>SS

Let>Source=L:\dos
Let>Dest=C:\_dos

Let>SName=miamigo.txt
Let>DName=miamigo%YYYY%%MM%%DD%%HH%%MM%%SS%.txt

CopyFile>%Source%\%SName%, %Dest%\%DName%

miamigo

THANKS !!

Post by miamigo » Tue Nov 11, 2003 8:39 am

A very good help - Thanks.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts