Creating a Robocopy script to copy multiple files into different directories

DanielG995

Commendable
Mar 22, 2016
2
0
1,510
Hello all,

Im new in the IT field and my boss has tasked me with creating a Robocopy batch script. The reasoning behind this is we have an XCopy script that allows one of our end users to copy over multiple files into a mapped network drive. The issue is that the script is literally just aimed to dump all the files from the laptop's C:\Recordings folder into the mapped network drive's root where our user then manually moves the copied files into the appropriate directories. What I want to do is create a script that moves the plethora of files and organizes them into the appropriate folders, therefore, providing our end user with a much easier, more efficient way to do the task at hand. What I'd like is some help on laying the ground work for the script because I'm definitely NOT the best script writer. Id like to see how one looks like and then craft it to fit my environment. Plus, any ideas are more than welcome on how I should approach this. I'm thinking about organizing the files by timestamps or find a way to do something such as if a file is new, to replace the old one in the directory it belongs to, or if nothing has changed to ignore it and leave it as is. Any ideas are welcome!

Update: I forgot to mention. These files are recordings..therefore they remain the same and they go into the same directories each time the copying needs to be done. These files do not change names or directories as of yet (more than likely not anytime soon). To clarify if anyone is confused. The files reside on the Laptop's "C:\Recordings" the xcopy script is copying ALL of that into the root of a mapped network drive on one of our servers, unorganized, not in any folders whatsoever. It is my job to find a way to organize these scattered files into the appropriate directories using a Robocopy batch file. I need the new files to go into the appropriate directories. The old files reside on the network drive's root but do not need to be copied into the directories since they've already been copied. Any help would be greatly appreciated!

Thank you.
 
Solution
There are a ton of script samples like this out there, I like using VBScript for this type of thing as it can handle reading files and names well and be able to setup variables to automatically copy the files.

You need more info about what you need to do though, are those files the same type all the time? Do they go in the same directories all the time or do those directories change based on user or project or file type? Things like that. Then you will know at least how the logic has to go and if any prompts from the user is needed. How will the script know what files go where? If all "Blue Movie" files were in a C:\User\Bob\Blue Movie folder and went into a K:\Blue Movie folder, and every file you do forever is in those folders...
There are a ton of script samples like this out there, I like using VBScript for this type of thing as it can handle reading files and names well and be able to setup variables to automatically copy the files.

You need more info about what you need to do though, are those files the same type all the time? Do they go in the same directories all the time or do those directories change based on user or project or file type? Things like that. Then you will know at least how the logic has to go and if any prompts from the user is needed. How will the script know what files go where? If all "Blue Movie" files were in a C:\User\Bob\Blue Movie folder and went into a K:\Blue Movie folder, and every file you do forever is in those folders, that is easy. If you have changing file and folder names and locations, not as easy.
 
Solution