Hey Experts. I am running a script that is dumping out data from our AD environment and the data goes into a log file. I run this script a couple times a week and I have to remember to rename the file .date before running the script. Because my memory is not the best, I would like the batch script to run and if the log file already exists that the existing file will be renamed to .old.%date%. Example:
data.log should be renamed to data.old.060413
The format of the date doesn't matter. It could be julian date or month/date. I just need it to be renamed. So far all I have is:
if exist c:\tools\file.log rename c:\tools\file.old.%date%
I appreciate your help!