file rename

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

Post Reply
snapper1969
Pro Scripter
Posts: 50
Joined: Fri Mar 23, 2007 10:14 am

file rename

Post by snapper1969 » Tue Feb 01, 2011 9:32 am

Hi,

I have a script that zips up some file, what I would like to do is add the current date and time to the end of the file and move it, any tips?.

Regards,

John

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

Post by Marcus Tettmar » Tue Feb 01, 2011 9:53 am

Year>yyyy
Month>mm
Day>dd
Let>new_file=c:\somewhere\myzip_%yyyy%%mm%%dd%.zip
RenameFile>source_file,new_file
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

snapper1969
Pro Scripter
Posts: 50
Joined: Fri Mar 23, 2007 10:14 am

Post by snapper1969 » Tue Feb 01, 2011 10:33 am

mtettmar wrote:Year>yyyy
Month>mm
Day>dd
Let>new_file=c:\somewhere\myzip_%yyyy%%mm%%dd%.zip
RenameFile>source_file,new_file
Thanks Marcus...this works except for the month, I'm not getting 02, it started at 44 and goes up by one each time I run the macro. Any ideas?.

Regards,

John

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Wed Feb 02, 2011 4:48 pm

Do you have "mm" in your script other than Month>mm?

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