noble123_2000
asked on
Urgent :Batch file for rename and copy the log file
Hi all,
I have a log file called "hr_xms_interface_vb.log" in D:\hr_xms_prog.
I have batch file which runs every day and gives me this log file (hr_xms_interface_vb.log).
That part works fine.
But now i want to copy this log file to D:\hr_xms_prog\hr_xms_inte rface_log_ backup folder.
and to rename it as hr_xms_interface_vb_001.lo g(For back up purpose). Next time when i run the batch file, i want the latest log file as hr_xms_interface_vb_001.lo g and the previous log file as(old log file) hr_xms_interface_vb_002.lo g. and so on.
I have to keep 5 days log file as back up. So in 6 th time,hr_xms_interface_vb_0 05.log has to be deleted and all others to be renamed correspondingly.
Could you please help me to write a batch file for doing this?
Thanks in Advance.
Noble
I have a log file called "hr_xms_interface_vb.log" in D:\hr_xms_prog.
I have batch file which runs every day and gives me this log file (hr_xms_interface_vb.log).
That part works fine.
But now i want to copy this log file to D:\hr_xms_prog\hr_xms_inte
and to rename it as hr_xms_interface_vb_001.lo
I have to keep 5 days log file as back up. So in 6 th time,hr_xms_interface_vb_0
Could you please help me to write a batch file for doing this?
Thanks in Advance.
Noble
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
hi all,
Thanks Ahoffmann and SysExpert for your fast reply.
Ahoffmann , Your solution is Perfect and thanks a lot!
SysExpert , Move works fine for me...
Thanks all
Regards
Noble.
Thanks Ahoffmann and SysExpert for your fast reply.
Ahoffmann , Your solution is Perfect and thanks a lot!
SysExpert , Move works fine for me...
Thanks all
Regards
Noble.
I hope this helps !