Batch file to rename files?
osaddict
London, UK
Right, I have NTBackup on the go - backing up to a HDD - It seems it basically deletes the previous nights backup and then just creates a new one.
So, I could rename the existing file and then when it looked to create a new one it would see a file with the name it was trying to create didn't exist... great!
So I thought I could write a batch file which would rename 'MorningBackup.bkf' to 'MorningBackup_GETDATE.bkf
So, any ideas how I rename a file through a batch file, and further still, how the renaming can be based on the date - i.e. like the sql getdate() function ?!
(Or have I missed something in NTBackup that would cater for this already lol)
So, I could rename the existing file and then when it looked to create a new one it would see a file with the name it was trying to create didn't exist... great!
So I thought I could write a batch file which would rename 'MorningBackup.bkf' to 'MorningBackup_GETDATE.bkf
So, any ideas how I rename a file through a batch file, and further still, how the renaming can be based on the date - i.e. like the sql getdate() function ?!
(Or have I missed something in NTBackup that would cater for this already lol)
0
Comments
But what I would suggest you do is instead of having just one scheduled nt job that runs every day. Make a seperate job for each day and just have that job save to a seperate folder.
I tried working my way through this:
http://www.experts-exchange.com/Storage/Removable_Backup_Media/Q_22408339.html
Earlier but got a little lost - in principal it could be an elegant solution - rename the file with the date it was made, then archive in to folders then delete folders.
Your way is simpler though, and something I can guarantee will work! (when I've implemented it that is!)