I have a script that I'm working on that I'm pretty stuck on... It may be just a syntax error but I'm not sure.
The script checks how old each file is that is hardcoded in the script (This script is a subscript that is being generated by another). The checkage2.bat script outputs an %AGE% variable if file is over 20 minutes old the AGE=1 otherwise AGE=0
SET FILEPATH="C:\PathToFile\Filename1.slf"
CALL C:\PathToScript\checkage2.bat %FILEPATH%
IF %AGE% EQU 1 OUTPUT=%OUTPUT% %FILEPATH%
SET FILEPATH="C:\PathToFile\Filename2.slf"
CALL C:\PathToScript\checkage2.bat %FILEPATH%
IF %AGE% EQU 1 OUTPUT=%OUTPUT% %FILEPATH%
SET FILEPATH="C:\PathToFile\Filename3.slf"
CALL C:\PathToScript\checkage2.bat %FILEPATH%
IF %AGE% EQU 1 OUTPUT=%OUTPUT% %FILEPATH%
IF (%OUTPUT%) == () GOTO OK
ECHO CRITICAL: %OUTPUT%
PAUSE
:OK
ECHO OK: All files within 20 minute time range
PAUSE
I'm trying to output a full list of all files that are over 20 minutes old but I can't seem to get it right! Any help will be really appreciated, thanks all!