So, I want to monitor a directory, and get an alert if any file in the directory was not modified in the last, 4 hours or so.
I think I'm on the right track, but I'm missing some pieces here. Any suggestions?
Here's what I got so far:
::Set time and date to use later if neededset currentTime_Date=%time% %date%
::For loop to pull the last file (I can't seem to pull the last modify time/date with it... this is where I need a hand)
FOR /F "delims=" %a IN ('DIR "*.*" /B /O:D') DO SET NewestFile=%a
::Email latest file using blat
blat.exe -to my@email.com -server server@domain.com -f from@email.com -subject "File Checker" -body "test" -attach %NewestFile% (Not sure if I can use the variable for my newest file here or not)
Any suggestions?
- Edited by JoeFri Friday, February 27, 2015 5:05 PM