Rename a file with part of it being current day's date.

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
smpayne69
Newbie
Posts: 1
Joined: Wed Jan 18, 2006 6:32 pm

Rename a file with part of it being current day's date.

Post by smpayne69 » Wed Jan 18, 2006 6:36 pm

I am setting up a macro to copy a file from one directory, then save it to another with part of the name being the current day's date. For example: rename report.snp to report011706.snp.

Is there anyone out there that would know how to do this??

Thanks!

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Jan 18, 2006 7:18 pm

Like this:

Year>yyyy
Month>mm
Day>dd
MidStr>yyyy,3,2,yy
MoveFile>report.snp,report%dd%%mm%%yy%.snp
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

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