I'm trying to write a batch file using robocopy and if statements.
because I have a lot of files and there is never a specific file name its a little tricky.
a little background on what Im doing so it make a little more sense.
I have a Folder that is located on a shared drive/server, this Folder has files necessary for a certain software. These files are configurable and I or other people in the group can open these files and modify them as needed. Well the thing is I do not want them to save it back to this Folder on the shared driver/server before they are approved.
So what I do is require them to save it to a "Need Approval" folder on their local machine.
I need to make a script that would look at that "Need Approval" folder on each local machine and robocopy files that are in there to "Need Approval" folder on a Shared drive/server
This way I can go to "Need Approval" folder on the shared drive/server and look at files that need to be reviewed and approved. So when I review and approve the files I will move them to "Approved" folder on the Shared drive/server
So, now I need a script to also be able to take files from the "Approved" folder and move them that folder I mentioned in very beginning. That folder that has all the files for the software. This is the main Folder that can not afford to be messed up. which is why I need this whole process.
Here is a catch though. When moving files from "Approved" folder which could be anywhere from 1 file to many I do not want them to just overwrite files in the destination folder (the main important folder)
What I need is an if statement to do something like this.... or maybe some other type of solution
if a file that is about to be copied exists in destination, back it up first to a different folder and then copy. else if the file that is about to be copied doesn't exist in the destination then go ahead and copy the file
because I have a lot of files and there is never a specific file name its a little tricky.
a little background on what Im doing so it make a little more sense.
I have a Folder that is located on a shared drive/server, this Folder has files necessary for a certain software. These files are configurable and I or other people in the group can open these files and modify them as needed. Well the thing is I do not want them to save it back to this Folder on the shared driver/server before they are approved.
So what I do is require them to save it to a "Need Approval" folder on their local machine.
I need to make a script that would look at that "Need Approval" folder on each local machine and robocopy files that are in there to "Need Approval" folder on a Shared drive/server
This way I can go to "Need Approval" folder on the shared drive/server and look at files that need to be reviewed and approved. So when I review and approve the files I will move them to "Approved" folder on the Shared drive/server
So, now I need a script to also be able to take files from the "Approved" folder and move them that folder I mentioned in very beginning. That folder that has all the files for the software. This is the main Folder that can not afford to be messed up. which is why I need this whole process.
Here is a catch though. When moving files from "Approved" folder which could be anywhere from 1 file to many I do not want them to just overwrite files in the destination folder (the main important folder)
What I need is an if statement to do something like this.... or maybe some other type of solution
if a file that is about to be copied exists in destination, back it up first to a different folder and then copy. else if the file that is about to be copied doesn't exist in the destination then go ahead and copy the file