So I hope I can explain this well enough for people to get. I am very bad at this sometime.
So I have a group in my company that drops files in a specific location(I'll call this the "home" directory from now on). From this "home" location when there is a new addition to the folder. Each individual in a remote office runs a small .bat file (the name is never the same). The bat file does some minimal tasks like reg's dll's and copy's the files from the "home" folder to the persons local drive which is the same location. So I would like to try to automate this task via a logon script.
Things it needs to do:
Check the "home" folder for new files. If new files are there, run the .bat file.
Compare what the user has on the local drive with whats in the "home" folder. If there is discrepancy's, run what needs to be ran so that user is up to date.
I found the attached code for a DOS .bat file that sort of does what I was looking to do, but could not get it to work. I'm also not hard set on keeping the folder structure, so if you come up with something that moves files into a "processed" folder or something like that, thats ok with me.
thanks again and please ask questions if this does not make any sense.
:: Copies Files Modified or Created Today
:: to the Upload Directory, or Copies
:: from the Specified Date Forward
If no Date is Given, Today's
IF "%1" == "" GOTO COPY-TODAY Files will be Copied
IF NOT "%1" == "" GOTO COPY-DATE Otherwise, Files will be Copied
Forward of the Date Typed
:COPY-TODAY (See Text, Below)
ECHO. | DATE | FIND /I "Current" > C:\BATCH\CUR-DATE.BAT
ECHO @SET CUR-DATE=%%4 > C:\BATCH\CURRENT.BAT
XCOPY *.* C:\UPLOAD /D:%CUR-DATE% < NUL Copies Files based on
("NUL" Hides Screen Messages)
:COPY-DATE Copies Files based on
XCOPY *.* C:\UPLOAD /D:%1 /-Y The Date Given at the
ECHO. Separates the Listing
CALL C:\BATCH\DR.BAT C:\UPLOAD Gives a Listing for the
UPLOAD Directory to
Show the Operation's Success
SET CUR-DATE= Removes the Date Variable
From the Environment
DEL CUR-DATE.BAT Deletes the
DEL CURRENT.BAT Temporary Batch Files