Discussion Locked

run script on folder content change

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I know this might be a bit vague, but I'm not necessarily looking for a comprehensive answer here, more or less a point in the right direction. Is it possible to run a script (more specifically and send a custom email) based on the contents of a shared folder (windows domain, windows 2003 server and xp pro clients) changing? i.e. I add files to a folder which triggers a script which sends an email. More specifically, this is for ftp. I know there are clients etc that do this, but I can't and won?t force our users to install and use an ftp client. I need the ease of use of internet explorer.

So the question is: Is there a 3rd party software to look at, or do I need to do this using windows components and scripting? If scripting, can anyone point me in a useful direction? Thanks a lot!

2 replies

by tony hopkinson

Three ways. The clever but advanced way is to install a hook into windows that will monitor changes to the folder. It would require you to write a program though. You'll be able to find an example for that on google. Unfortunately the event would fire on each change so unless you had some sort of queueing/deferrment mechanism, you'd get an email for each individual change.
The other way is to schedule a script that lists the content of teh folder to a file, compares it to the last one and emails if they are different. Then you simply need to pick an optimal time for scheduling how often you check for changes.
The third is to buy something, but it's likely to be more than you need, and less than you want.

This discussion is closed to new replies.