If you need to be notified when a file arrives in a folder, schedule NewFile.bat to start when the computer starts.
NewFile.bat uses BLAT freeware to e-mail the notification, and a Sleep alternative to wait 5 minutes before re-checking the folder.
You will need to modify the folder path from C:\folder, and the recipient's e-mail address.
NewFile.bat contains:
@echo off setlocal REM Modify the folder path cd /d c:\folder if not exist filelist.txt @echo ZZZZZZ_EOF.ZZZ>filelist.txt :again copy filelist.txt filelist.old del /q filelist.txt if exist filelist.new del /q filelist.new for /f "Tokens=*" %%f in ('dir /b /a-d *.*') do @echo "%%f">>filelist.txt findstr /L /I /V /B /G:filelist.old filelist.txt>>filelist.new set sent=N for /f "Tokens=*" %%n in (filelist.new) do call :new %%n REM Sleep 5 minutes @ping -301 Times 127.0.0.1>nul goto again :syntax @echo Syntax: newfile folder endlocal goto :EOF :new if "%sent%" EQU "Y" goto :EOF if /i %1 EQU "ZZZZZZ_EOF.ZZZ" goto :EOF if /i "%~n1" EQU "filelist" goto :EOF REM Modify the recipient blat filelist.new -to [email protected] -s "New files." set sent=YFor a commercial monitor (and much more), see OpalisRobot.
0 comments
Hide comments