Scheduled Task

Bozo

Storage? I am Storage!
Joined
Feb 12, 2002
Messages
4,396
Location
Twilight Zone
The Scheduled Task utility in Windows 7 sucks donky balls.
I have been trying some free utilities without much success.
Anyone have any suggestions?

Thanks
 

Mercutio

Fatwah on Western Digital
Joined
Jan 17, 2002
Messages
22,303
Location
I am omnipresent
I haven't had any problem with the Windows 7 Scheduled Tasks Applet. What is the basis for your objection?
 

Bozo

Storage? I am Storage!
Joined
Feb 12, 2002
Messages
4,396
Location
Twilight Zone
I have one computer that has 28 scheduled task on it. We always leave the scheduled task window up so we can see what's happening, if there was a problem, and whats running. The Windows 7 scheduled task window must be refreshed manually if want to see what is happening or what happened. Windows XP scheduled task window updated in real time, automatically.
 

BingBangBop

Storage is cool
Joined
Nov 15, 2009
Messages
667
Doesn't the logs of event viewer need to be refreshed manually if left up on the screen?
 

Bozo

Storage? I am Storage!
Joined
Feb 12, 2002
Messages
4,396
Location
Twilight Zone
The computer in question is dedicated to doing scheduled tasks. Usually 4-6 an hour, 24/7/365.
It's nice to be able to look at the screen an see what task has run and when, if there were any errors, and what is going to run next. With Windows 7 you must refresh the screen each time you need to see an update on anything. SUCKS.

I decided to install XP on the new hardware. MS is going to support it for a couple of years yet and I should be retired by then. :-D
 

Handruin

Administrator
Joined
Jan 13, 2002
Messages
13,931
Location
USA
Since refresh doesn't work for the TaskScheduler, how open are you to creating your own monitoring tool of the Windows 7 TaskScheduler? There is a library in the codeplex that offers some insight into TaskScheduler.

Below is just an example of accessing certain properties of scheduled tasks. There is no output or anything, but a simple gui or tray-based application could alert you every n number of minutes for certain types of task status. What would be better is if I can find events that were exposed to catch when a task has changed state, etc, but I don't see them with this library. The next best case is to define your own polling value and have it update that way.

Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Win32.TaskScheduler;

namespace WinTaskScheduler
{
    class Program
    {
        static void Main(string[] args)
        {
            using (TaskService ts = new TaskService())
            {

                RunningTaskCollection rtc = ts.GetRunningTasks();
                
                foreach(Task t in rtc)
                {
                    if (t.Enabled)
                    {
                        
                        String name = t.Name;
                        DateTime dt = t.LastRunTime;
                        int lastResult = t.LastTaskResult;
                        DateTime nextRun = t.NextRunTime;
                        int numRuns = t.NumberOfMissedRuns;
                        String path = t.Path;
                        TaskState taskState = t.State; //taskState.ToString();
                        
                        
                    }
                }

            }

        }
    }
}
 
Top