Batch File - Check file exists
Posted on 2014-02-06
I don't know if this can be done with batch scripting, but I need to check in a folder to see if all the text files in that folder already exists in another or not. Or if I can read the network folder.
I have a folder called "JOBS" that has 2 sub folders "Archive" and "Error". The bat script will copy all files with extension "txt" into a network folder "\\bb\nlc\tr\JOBS". Once it's done copying, it'll check and see if the same file from "JOBS" exists in the network folder "JOBS". If it does not exists or can't read the network folder, move all the files into a folder called "Error". If it exists, then move it to a folder called "Archive".
Is this even doable with batch jobs? I know the moving and copying can be done. Just not sure about the checking if a file exists or can read/see the network folder.