Test result of Windows Scheduled Tasks

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
User avatar
Stoltze
Posts: 174
Joined: Tue Feb 03, 2004 1:58 am
Location: Denmark

Test result of Windows Scheduled Tasks

Post by Stoltze »

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
Last edited by Stoltze on Thu Jun 08, 2006 11:52 pm, edited 1 time in total.
Yoorix
Posts: 177
Joined: Wed Dec 14, 2005 8:28 am

Post by Yoorix »

You may use WMI query. Following article might be helpful:
http://msdn.microsoft.com/library/defau ... _tasks.asp

Regards,
Yoorix
User avatar
Stoltze
Posts: 174
Joined: Tue Feb 03, 2004 1:58 am
Location: Denmark

Post by Stoltze »

Yoorix wrote:You may use WMI query.
Hmm.. Scripting... :) Oki, thats one way to do it...

Are there any other ways? Perhaps anyone knows, if it's possible to get it to write the result in the Event Viewer?
Yoorix
Posts: 177
Joined: Wed Dec 14, 2005 8:28 am

Post by Yoorix »

Stoltze wrote:Hmm.. Scripting... :) Oki, thats one way to do it...
No scripting ;-)

You should use WMI test method and query like Select * from Win32_ScheduledJob or Select JobStatus from Win32_ScheduledJob as described in foregoing article.

Regards,
Yoorix
User avatar
Stoltze
Posts: 174
Joined: Tue Feb 03, 2004 1:58 am
Location: Denmark

Post by Stoltze »

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.
Oki.. Looked at bit more at it now.. :)

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

Thnx... :wink:
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

Stoltze wrote:Just need to get hold of manual creation of scheduled task now... :-?
You may try schtasks command line utility to create scheduled task.

Regards,
Max
User avatar
Stoltze
Posts: 174
Joined: Tue Feb 03, 2004 1:58 am
Location: Denmark

Post by Stoltze »

KS-Soft Europe wrote:
Stoltze wrote:Just need to get hold of manual creation of scheduled task now... :-?
You may try schtasks command line utility to create scheduled task.
Great! That was just what I needed!! Thnx..
fishvict
Posts: 34
Joined: Tue Dec 16, 2003 10:47 am

Post by fishvict »

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.
Post Reply