0

The Mac has a very nifty feature called folder actions which allow a script to be run every time a folder's contents change. Is there any equivalent to this functionality built in to Windows? I'm specifically interested in either Windows 7 or Windows Server 2008 R2. Links to documentation on such a feature would be most appreciated as well. Thanks!

Oliver Salzburg
  • 86,445
  • 63
  • 260
  • 306
eykanal
  • 123
  • 1
  • 7
  • Something like this? http://leelusoft.blogspot.in/2011/10/watch-4-folder-23.html – sgtbeano Dec 03 '13 at 15:54
  • @sgtbeano - That would be great, but I'm specifically asking if there's anything like that built into the Windows OS. – eykanal Dec 03 '13 at 16:54
  • Ah okay, sorry about that - I should have read the question more closely. – sgtbeano Dec 04 '13 at 09:13
  • Would this work - http://superuser.com/questions/226828/how-to-monitor-a-folder-and-trigger-a-command-line-action-when-a-file-is-created - basically create a batch file to do the watch and then call if via task scheduler at regular intervals? Also - http://msdn.microsoft.com/en-us/library/aa365261(VS.85).aspx – sgtbeano Dec 04 '13 at 09:18
  • @sgtbeano - Wow, thanks. The first is polling, which is what we currently do and what I'm trying to avoid. The second is cool... not quite the OS-level (or even script-level) functionality I was hoping for, but we may be able to use it. If you add that as an answer I can +1 it! – eykanal Dec 04 '13 at 15:05

1 Answers1

2

As per the comments above. The two options I can see are either to create a batch file to do the watching of a folder and then call it via task scheduler;

How to monitor a folder and trigger a command-line action when a file is created or edited?

Alternatively, you could code a solution using C++ or similar to take advantage of directory change notification as detailed on MSDN here;

http://msdn.microsoft.com/en-us/library/aa365261(VS.85).aspx

As you rightly say, neither is a truly native solution, however either should get you the desired result.

sgtbeano
  • 571
  • 3
  • 13