How to monitor a folder for changes, and execute a command if it does, on Windows?

I've had good success with an old program called Log Monitor. It's ancient, and long ago abandoned. But it serves the purpose pretty well.

I have created a simple utility for this purpose:

usage: when_changed (file path) (command) (optional-parameters)

e.g. when_changed C:\somedir\foo.txt myapp.exe bar wibble 123

With .NET watchfolders this is really easy to code. I'm sure someone have done such a program.

Just found this gem for you