I am in need of a batch program that will copy dated folders from local machines back to the server. The batch file will be run from each user on the server. The following scipt works well except I need to get the previous days folder and not the current. Any suggestions? Also, is there a way to zip the folder once it's copied using a batch command?
@ECHO OFF
ECHO.
ECHO Copying today's folder...
FOR /F "tokens=2-4 DELIMS=/ " %%F IN ('date /T') DO (set v_date=%%H%%F%%G)
MD q:\Archive\%v_date%
ECHO.
ECHO Copying '%v_date%'...
COPY /V /Z "v:\aloha\%v_date%" "q:\Archive\%v_date%"
ECHO.
copy /Y v:\aloha\*.txt q:
ECHO Finished copying.
ECHO.
@ECHO OFF
ECHO.
ECHO Copying today's folder...
FOR /F "tokens=2-4 DELIMS=/ " %%F IN ('date /T') DO (set v_date=%%H%%F%%G)
MD q:\Archive\%v_date%
ECHO.
ECHO Copying '%v_date%'...
COPY /V /Z "v:\aloha\%v_date%" "q:\Archive\%v_date%"
ECHO.
copy /Y v:\aloha\*.txt q:
ECHO Finished copying.
ECHO.