Schedule a Task to Run When Another Completes on Windows Server 2003

scheduled-taskwindows-server-2003

On Windows Server 2003, I have a task that is scheduled to run every morning at 12 am. The time it takes to run varies since it is a search engine spider that crawls a website. I want to have a batch script run when the task ends. Is there a way to do that using Task Scheduler or no?

Best Answer

The simplest way would be to use a batch file that runs the first command with START /WAIT.

E.g.

start /wait spider.bat
secondjob.bat

The batch file will then pause and wait until the "spider" task finishes and then run your next script. (Or an executable, this will work for executables as well as .bat/.cmd scripts)