How to do this task?
Posted: 12 Jul 2011 09:42
Hi folks,
I haven't done this for too long, I hope you guys can refresh my brain for it:
I have a folder which stores weekly update files copied from another server. I need to keep only 4 files. So every time I run the batch file, I want to check the number of files, if it's less than 4, then do nothing; if it's more than 4, then find out the oldest one, delete it, then copy the latest one into this folder.
If possible, (I guess it's impossible, I will have to write a .NET program to do it) I also want an email be sent out after the copy/deletion job is done.
Thank you very much.
I haven't done this for too long, I hope you guys can refresh my brain for it:
I have a folder which stores weekly update files copied from another server. I need to keep only 4 files. So every time I run the batch file, I want to check the number of files, if it's less than 4, then do nothing; if it's more than 4, then find out the oldest one, delete it, then copy the latest one into this folder.
If possible, (I guess it's impossible, I will have to write a .NET program to do it) I also want an email be sent out after the copy/deletion job is done.
Thank you very much.