@echo off 

set DATESTAMP=%DATE:~10,4%_%DATE:~4,2%_%DATE:~7,2% 
set TIMESTAMP=%TIME:~0,2%_%TIME:~3,2%_%TIME:~6,2%
set DATEANDTIME=%DATESTAMP%_%TIMESTAMP%

echo

echo ENTERED ApplyUpdate.bat @ Date (YYYY_MM_DD) and time: %DATEANDTIME%

setLocal enableDELAYedeXpansion

for /f "tokens=* delims= " %%a in (".\updates\dl\*.apply") do (
   set F=%%~Na
   IF /I "!F!" NEQ "*" (
      echo FOUND A FILE OTHER THAN *
      echo ".\updates\dl\!F!"
      IF EXIST ".\updates\dl\!F!" (
         echo Update Found... Applying Update... !F!
         call .\updates\BootstrapUpdateOnClient.bat "!F!"
      ) else (
         echo No Pending Updates Found...
      ) 
   ) else (
      echo No Pending Updates Found...
   )
)
