Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Can I trigger a scheduled task when the contents of a folder change?

13 Aug 2012   #1
nzdreamer55

Windows 7 Home Premium 64bit
 
 
Can I trigger a scheduled task when the contents of a folder change?

Hello everyone,

I want to use the windows task scheduler to run a task when something is copied to a folder on my server. When this happens several programs run and extract files, rename them and move them automatically.

Right now I have the window task scheduler running a task every 5 minutes on this folder so when something get's copied into it the files will be processed, however this is a really bad way of doing this. I saw under the task scheduler trigger I could begin the task on an event and that I could create a filter based on something.

The problem is I don't know if there is anything that can be used when a folder changes. I have attached a picture showing the trigger and filter screen so you can see what I am talking about. Is there something on the right (encircled with red) that I could use?

I know that there are a lot of ways of doing this (monitoring a folder) and a lot of other programs that will "just do it for you", but I would like to come up with a solution using windows task scheduler if possible.

Thank you in advance for your help.
-S




Attached Thumbnails
-task-scheduler.jpg  
My System SpecsSystem Spec
.

16 Aug 2012   #2
nzdreamer55

Windows 7 Home Premium 64bit
 
 

Well I guess this must not be done very often as still no replies. If a mod thinks this should be in a different forum could you let me know? If someone knows of a forum that would be better I would love to hear about it.

Thanks again for any help you can provide.

-S
My System SpecsSystem Spec
18 Dec 2012   #3
sansay

windows 7 Enterprise
 
 
Same problem but...

Hi nzdreamer55,

I am a software engineer. I was looking for an easy solution to do exactly what you want, but it looks like very few people need this. So I am going to work on it tonight. I will let you know what I find out.

Serge
My System SpecsSystem Spec
.


20 Sep 2014   #4
stiasny

Windows 8.1 64
 
 

Dude, did you manage to get the correct answer from anybody? I need exactly the same thing. Thanks
My System SpecsSystem Spec
20 Sep 2014   #5
sansay

windows 7 Enterprise
 
 

Sorry but I do not recall what happened regarding this project. I either got too busy with more important issues or found that you can't do this with Window Scheduler.
The following article confirms the second possibility is true:
Build a 'Folder Watcher' Service in C# | .NET Framework content from Dev Pro
My System SpecsSystem Spec
20 Sep 2014   #6
MilesAhead

Windows 7 32 bit
 
 

I hope the server is mostly idle. Any time I tried anything that automatically detected folder changes it bogged the entire system by hogging the HD. It relentlessly checks every file in the folder tree to see if the modification,access times etc.. are the same as last time. If you have thousands of files in that folder tree you can see why the system would bog.

For this type of stuff to work smoothly I suspect the file system needs to be implemented as a true relational database. Then changes are logged as they happen. No big performance hit.

I don't know any Windows file system that fits that description though.

Edit: Long story short, you are probably better off polling every so many minutes.
My System SpecsSystem Spec
21 Sep 2014   #7
Tookeri

Windows 7 Pro 32
 
 

Here's an VBS example that uses WMI to subscribe to file changes in a folder: New, changed, deleted
I've tried it briefly without problems.

WMI and File System Monitoring - CodeProject
My System SpecsSystem Spec
21 Sep 2014   #8
Tookeri

Windows 7 Pro 32
 
 

And if you modify the above VBS example to write a specific event in the event log instead of alerting messages, you can then set a trigger for this new event in a scheduled task. Example:

VB Script to write an event with specific eventID and eventSource into eventlog
My System SpecsSystem Spec
21 Sep 2014   #9
MilesAhead

Windows 7 32 bit
 
 

WMI may work a bit better. But I know for a fact the WinAPI for file change notification is a dog. You have more leeway with a server to be sure. Running the WinAPI call on the workstation is a disaster.
My System SpecsSystem Spec
Reply

 Can I trigger a scheduled task when the contents of a folder change?




Thread Tools





Similar help and support threads
Thread Forum
Can't change MC update scheduled task. How come
As everyone on here probably knows MC update has a default scheduled task to run at 3:00 am every night. I have tried to delete or disable the task but I cannot. I used the built-in Administrator account to delete the task yesterday afternoon but it was back this morning. How can I get rid of...
Media Center
powercfg /waketimers bug when modifying trigger of scheduled task
Hello, I have the following three observations concerning powercfg /waketimers 1 When powercfg /waketimers shows a task, the time when that task will run is about the same as specified in the trigger for that task in Task Scheduler. But when making changes to the trigger time of that task...
Performance & Maintenance
Scheduled Task history indicates task completed successfully but....
Hi, New here. I'm using a Scheduled Task to fire a very simple bat file that pulls, compresses and pushes a set of files to a different network directory. The bat file runs fine manually. On a networked desktop I have set up the task to run at about 5am est (waking the machine), as highest...
Performance & Maintenance
Can't install > can't change contents of folder.
Hello, I'm having an issue with installing certain things, such as plugins for Firefox, but also other small software I have to download first. When I try to install, for example, the Flash plugin via the official website, I get this message in a popup: ...
Installation & Setup
Unable to change folder contents on remote folder in same HomeGroup
Hello, first I want to apologize up front if this topic has already been posted with the problem resolution as well. I have searched throughout the networking and sharing threads but was unable to find what I'm looking for... I have two computers in my home, a Tower PC and a Laptop both...
Network & Sharing
Help with using idle trigger in Win Task Scheduler
OK I know i've bombarded the forums lately with a couple threads all somewhat related. Point of this thread -- how to correctly set the idle trigger in windows task scheduler. There is a MSFT article Task Idle Conditions (Windows) which tries to explain it, but I can't figure it out. I...
Performance & Maintenance

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 18:52.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App