• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3180
  • Last Modified:

Scheduled Task (Server 2008) trigger on file create

Need to create a Sceduled Task, which trigger on a file create in a folder.
I'll then run a Powershell-script looping all files and do some processing.
Any idea ?
0
matemat
Asked:
matemat
2 Solutions
 
Neil RussellTechnical Development LeadCommented:
A scheduled task runs on a schedule NOT on a file being created, thats not a schedule.

You would need to write a script that monitors the folder for the creation of the file and have it run 24/7 looping the check.
0
 
matematAuthor Commented:
Ok, let me rephrase then :-)
I'm wondering if it is possible to use "Task Scheduler" to perform such a job for me ?
Not triggering on Schedule, but "on an event".
0
 
David Johnson, CD, MVPOwnerCommented:
The first answer is correct you will need the process to run continuously
0
 
Brent ChallisPrincipal: ITCommented:
A better approach would be to use the FileSystemWatcher from the .NET Framework as this means that the system itself will monitor the directory and call code in terms of new/updated/deleted files.

Here is a reference for the use of the FileSystemWatcher in PowerShell:
http://gallery.technet.microsoft.com/scriptcenter/Powershell-FileSystemWatche-dfd7084b
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now