Hello all! I have a folder called "Data", which contain our "project folders", as well as some others. All of the Project Folders are named something like "2205009". Within each of these project folders are 5 folders "Contracts", "Correspondence", "Documents", "Graphics", and "Reports". I have a batch file that will scan all of the inboxes on our mail server, and will move the actual email files ( the email files have a ".mai" extension) to the appropriate "Correspondence" folder.
By the way, if I am sending an email to someone concerning Project #2205009, I will, in the email message, put in the CC field "email@example.com", which will drop that email file into that project number's mailbox. This way, all correspondence about a particular project will be easily accessible to everyone, and we don't have to worry about who wrote what about a particular project, all the correspondence will be in one folder.
The batch file works wonderfully, however, I'm still left with these email files that have names with absolutely no meaning whatsoever. For instance, one of the email files is named "43B7E3E4C6744CC6AE23437B5
. I would like to have a script that will search within all of the Correspondence folders (which again are located in each of the Project Folders), and will rename only files that have the ".mai" extension to something like 040605_090354.mai, which would represent date_time in this format: mm/dd/yy_hh:mm:ss in 24-hour time. Is this possible?
I read in a PC Magazine article (http://www.pcmag.com/article2/0%2C1759%2C1386947%2C00.asp
), where this can be done in a batch file. I was going to try to incorporate what it says in that article into my existing batch file, but it will not display seconds. And there would be times when multiple emails about a particular project are sent by multiple people, possibly within the same minute, so there would be some issues there. So I would need either to show seconds in the file name, or which would rename the files incrementally such as 040605_0903a, 040605_0903b, 040605_0903c, etc.
Can anyone help? :)