views:

14

answers:

1

Hi all, I wrote a Python script that I need to have installed on Windows Server 2003 R2, that will run when a specific directory is changed in any way (new files, deleted files, etc). I believe I need to register this as a system service, in order to listen for that, but I'm really not sure.

So, my question is this: does such a script need to be registered as a service, and if so, how do I go about doing that?

Thanks.

+1  A: 

I believe your program will have to watch the directory for changes and act according. Alternatively, you could have a separate program watch the directory and then invoke your script, but this is essentially the same.

Tim Golden has an article here which discusses directory watching using python and the win32 api.

After you get that working, it would be very appropriate to have your program run as a service. This has been covered before.

Mark
Awesome. That's exactly what I was looking for. Thanks!
tjsimmons