Here is an option for you.
Create a text file with the contents of the TREE of folders and files.
The text file will contain the full path to the file, the date modified and the file size.
This can easily be done with the DIR command executed within the FOR command.
Code: Select all
@echo off
pushd "c:\art_assets"
FOR /F "delims=" %%G IN ('DIR /B /S') DO >>"C:\path to BatchFiles\TreeExisting.txt" ECHO %%~G,%%~tG,%%~zG
popd
You would run the above code once you know everything is up to date and you have already run your build command. This code would only be run once. This will give you a base listing of what is currently in your folder and sub folders to compare to another file that will be created.
Now every X minutes you could schedule this batch file to run to compare the previous tree structure to the current tree structure.
Code: Select all
@echo off
pushd "c:\art_assets"
FOR /F "delims=" %%G IN ('DIR /B /S') DO >>"C:\path to BatchFiles\TreeCurrent.txt ECHO %%~G,%%~tG,%%~zG
popd
FC TreeExisting.txt TreeCurrent.txt >nul
IF %ERRORLEVEL% GTR 0 THEN (
CALL build_assets.bat
del TreeExisting.txt
ren TreeCurrent.txt TreeExisting.txt
)
Put all your Batch files that you will be running into a folder outside of your folder tree that you are monitoring. This is where the Tree listings will exist as well.