Hi,
Is it possible to test the last result of Windows Scheduled Tasks?
Eg "Run at xxxxx", "unable to start" etc...
AHM version 5.92
Test result of Windows Scheduled Tasks
Test result of Windows Scheduled Tasks
Last edited by Stoltze on Thu Jun 08, 2006 11:52 pm, edited 1 time in total.
You may use WMI query. Following article might be helpful:
http://msdn.microsoft.com/library/defau ... _tasks.asp
Regards,
Yoorix
http://msdn.microsoft.com/library/defau ... _tasks.asp
Regards,
Yoorix
Oki.. Looked at bit more at it now..Yoorix wrote:You should use WMI test method and query like Select * from Win32_ScheduledJob or Select JobStatus from Win32_ScheduledJob as described in foregoing article.

Looks like what I need.. Just need to get hold of manual creation of scheduled task now...

Thnx...

-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
There is a catch to using WMI that I found... WMI only works with tasks that were created using the "AT" command. It does not work with tasks scheduled with the "Scheduled Task Wizard". So, the next question is, how do I monitor tasks created with the wizard?
So far, I have an idea, but haven't gotten too far with it.
You can get the status by running schtasks and outputting to a file. The fun part is parsing the file, because you can't output the results of just a single task, its the whole list.
If anyone has any ideas, I'd appreciate it.
Thanks.
So far, I have an idea, but haven't gotten too far with it.
You can get the status by running schtasks and outputting to a file. The fun part is parsing the file, because you can't output the results of just a single task, its the whole list.
If anyone has any ideas, I'd appreciate it.
Thanks.