This is an old revision of the document!
@echo off @echo Checking for new Chroma-Tec orders and copying files @echo 2016 Andr‚ Le Comte :start timeout /t 10 @echo Checking for any order folders that were modified more than seven days ago and deleting them. ForFiles /P Z:\COMMUNITY_ARTWORK\Chroma-Tec\_LICENSED\Orders /D -7 /C "CMD /C if @ISDIR==TRUE echo RD /Q @FILE &RD /Q /S @FILE" @echo Searching for new Chroma-Tec orders. If orders are found then images will be copied for printing. if exist Z:\COMMUNITY_ARTWORK\Chroma-Tec\_LICENSED\Order_data\new.csv (goto copy) else (goto start) :copy Z: CD Z:\COMMUNITY_ARTWORK\Chroma-Tec\_LICENSED\Orders set hour=%time:~0,2% if "%hour:~0,1%" == " " set hour=0%hour:~1,1% set min=%time:~3,2% if "%min:~0,1%" == " " set min=0%min:~1,1% set secs=%time:~6,2% if "%secs:~0,1%" == " " set secs=0%secs:~1,1% set year=%date:~-4% set month=%date:~4,2% if "%month:~0,1%" == " " set month=0%month:~1,1% set day=%date:~7,2% set days=%date:~0,3% if "%day:~0,1%" == " " set day=0%day:~1,1% @echo Making folder for order %year%-%month%-%day% %hour%-%min% %days% MKDIR "%year%-%month%-%day% %hour%-%min% %days%" @echo Copying files for order %year%-%month%-%day% %hour%-%min% %days% FOR /F %%a in (Z:\COMMUNITY_ARTWORK\Chroma-Tec\_LICENSED\Order_data\new.csv) DO COPY %%a "Z:\COMMUNITY_ARTWORK\Chroma-Tec\_LICENSED\Orders\%year%-%month%-%day% %hour%-%min% %days%\%%~nxa" @echo Deleting order data %year%-%month%-%day% %hour%-%min% %days% DEL Z:\COMMUNITY_ARTWORK\Chroma-Tec\_LICENSED\Order_data\new.csv goto start