I am looking to compare a portion of a file name, to a directory name, and move the file that matches the directory name to that matching directory. On top of that, I would also like the user to be able to append a user defined date onto any files it will be moving.
Here is a sample of what I am looking to accomplish using windows scripting (if possible):
Data files reside in \\server1\Share\
Sample File Names:
(there will be hundreds of variations on the file names, possibly multiple files for one ###XXX)
Destination is \\server2\share\
Sample Directory Names (hundreds of directories):
I want the script to compare the first 6 characters of the file name in \\server1\Share\, and then move it to the matching directory in \\server2\share\
At some point in this process, I think it may be easiest to do this while all the files are together on \\Server1\Share, I would like a user defined date to appended to the end of all file names.
The final result would look something like this:
1. Prompt for the user to enter a date to append to all files at the end of the file name (before the extension)
2. Append UD Date and then compare the first 6 Characters of the file names on \\Server1\Share\ to existing directories on \\Server2\Share
3. Move the files to the appropriate directories
4. End Result:
(the '_' in between the file name and date is completely optional, just thought it looked cleaner)
If I could assign a billion points to this, I would. Any help would be greatly appreciated. I am familiar with windows scripting, I have used it quite a bit, but I dont use it enough to create something as complex (or so it seems) as this.
Thanks very much for your help in advance.