|
-
Mar 23rd, 2010, 07:07 AM
#1
Thread Starter
PowerPoster
Windows Task Scheduler in Windows Server 2008 R2
I have nightly tasks scheduled on a Windows Server 2008 R2 machine. The first one kicks off at 5:00 and produces a file. The second one runs at 5:05 and emails me the contents of that file.
This morning for the first time ever, I received an email containing only yesterday's date. That is usually the first line of text, followed by much more.
The reason is the 5:00 program wasn't done (it took 10 minutes instead of the usual one minute or less). So the 5:05 program ran and didn't have the input file completely available.
Is there a way to string together your actions in the task scheduler so that a second program will run when the first program is finished? It seems there are ways to wait for an event to occur, but I don't know how to make the first program produce an event that would get logged and thereby initate the second program. Right now they are scheduled as individual tasks based on clock time. Though it's been fine up to now, I hate having to guess how much time the first program will need.
The first program is written in VB6 and the second program is written in VBScript.
Thanks.
There are 10 kinds of people in this world. Those who understand binary, and those who don't.
-
Mar 23rd, 2010, 07:49 AM
#2
Re: Windows Task Scheduler in Windows Server 2008 R2
Use a BAT file to launch your exe files one after the other.
Then schedule this batch file instead of individual exe files.
-
Mar 23rd, 2010, 07:51 AM
#3
Re: Windows Task Scheduler in Windows Server 2008 R2
e.g. Contents of the .BAT file
Code:
start /w program1
start program2
-
Mar 23rd, 2010, 07:59 AM
#4
Thread Starter
PowerPoster
Re: Windows Task Scheduler in Windows Server 2008 R2
That makes me wonder why the tasks weren't set up that way from the very beginning. Why would the developer before me have guessed how long it would take to run his first program? He guessed five minutes. Then there's three hours between the second program and the third. I usually think people have a reason for doing things the way they did it originally. Maybe the first program never took 10 minutes in all its past runs. Maybe it never will again.
Thanks. I'll think about what I want to do.
There are 10 kinds of people in this world. Those who understand binary, and those who don't.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|