Go Back   TechArena Community > Technical Support > Computer Help > Windows Server > Windows Server Help
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



VB script for monitor the scheduled tasks and send Email notification

Windows Server Help


Reply
 
Thread Tools Search this Thread
  #1  
Old 22-05-2008
Wendy
 
Posts: n/a
VB script for monitor the scheduled tasks and send Email notification

Any idea about how to write a VB script to monitor the scheduled tasks and send an email notification if a scheduled task does not complete successfully. This is for Windows 2003 server.

Thanks. Wendy

Reply With Quote
  #2  
Old 22-05-2008
Pegasus \(MVP\)
 
Posts: n/a
re: VB script for monitor the scheduled tasks and send Email notification

Here are a couple of options:

- Check the ErrorLevel of each command executed by your scheduled task, then use blat.exe (downloadable from many sites) do generate a notification EMail to yourself.
- Use the Task Scheduler to run this batch file once every few hours:
01. @echo off
02. for /F "delims=" %%a in ('schtasks /query /v /fo:list ^| findstr /i
"Taskname Result"') do call :Sub %%a
03. goto :eof
04.
05. :Sub
06. set Line=%*
07. set BOL=%Line:~0,4%
08. set MOL=%Line:~38%
09. if /i %BOL%==Task (
10. set name=%MOL%
11. goto :eof
12. )
13. set result=%MOL%
14. echo Task Name=%name%, Task Result=%result%
15. if not %result%==0 (
16. echo Task %name% failed
17. echo blat.exe .. .. ..
18. )
Reply With Quote
  #3  
Old 13-01-2014
Member
 
Join Date: Jul 2011
Posts: 263
Re: VB script for monitor the scheduled tasks and send Email notification

You can also try using Task Scheduler. You can find some options in the below link. This tool will help you to get the kind of output you are looking for. It is a bit easy to configure any automated things using Task. Because you can configure it in the graphical way. I am not very use to using scripts. Most of the they do not work. I had tried using them many times but it failed. Later on I started using Task with different kind of settings and it worked. There is no issue at all. You can try checking details of below link. There are more relative information available on it.

Run a Task in Response to a Given Event
Reply With Quote
  #4  
Old 14-01-2014
Member
 
Join Date: Aug 2011
Posts: 400
Re: VB script for monitor the scheduled tasks and send Email notification

The following link can help you. This link is based on configuring task through script. A sample script is also provided on the same. You have to go through the link and try to understand how it works. You can then configure it as per your need. In the same link there are more topics like WMI Tasks for Scripts and Applications. Where more advance topics are configured. MSDN is the best source to locate information on various things. I always keep on checking new articles here. WMI Tasks for Scripts and Applications is complete guide to manage task with various things.

WMI Tasks: Scheduled Tasks
Reply With Quote
Reply

  TechArena Community > Technical Support > Computer Help > Windows Server > Windows Server Help
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "VB script for monitor the scheduled tasks and send Email notification"
Thread Thread Starter Forum Replies Last Post
Acronis Backup & Recovery 11 does not send email notification Aneat Windows Software 5 11-01-2012 03:33 AM
How to send email notification program in Visual C++ Farzana Software Development 5 27-06-2011 06:29 AM
Windows Scheduled Tasks don't luanch if tasks not finished Andy Candy Windows Software 3 21-08-2009 11:47 AM
Scheduled Tasks: Notify me of missed tasks Hrishia Windows XP Support 1 02-01-2009 02:45 PM
Where are kept Scheduled tasks? Jack Vista Help 8 18-01-2008 01:28 AM


All times are GMT +5.5. The time now is 05:49 PM.