HiTek Software Home
 
File Monitor task to monitor directory for total accumulated files
Date Updated  -  07/22/2007
Description
User needs to monitor a folder for incoming files.  Whenever the total files in the folder exceeds 10, he needs to launch a script that will process the files files and move them out of the folder.
Solution

1)  Create the Command / WinCommand task to launch your file processing script (TaskTitle = fileCrunch)

2) Create a File Monitor task as follows:
Dir to monitor = c:\production\incoming
Filename = [leave blank]
Task to Run = fileCrunch
Select the option: Run task if total files in directory greater than 10

3) Schedule this task to run every 2 minutes  i.e. this task will run continuously 24 hours a day.  If more than 10 files are accumulated into the folder, the file processing program is launched via the Command / WinCommand task.