Link to home
Start Free TrialLog in
Avatar of tristonyip
tristonyip

asked on

send notification on window sever 2003 task scheduler

hi
I am using the Windows server 2003 Task Scheduler to run a batch file, but is it possible i can get a notification if the task success?
Avatar of Chris B
Chris B
Flag of Australia image

What is the task? If for example it creates a file, you could run another task to check for it's existence, then send yourself an email with blat.

Chris B
Avatar of kevinhsieh
How about just have the batch file send the email? I typically have the batch file write out to a log file, and then email the log file at the end of the script. If I don't get the email, the script didn't run.
Avatar of tristonyip
tristonyip

ASKER

good, how can i write a script like that, thanks
blat -server smtpservername-to address@yourdomain.com -f administrator@yourdomain.com -subject "task on %COMPUTERNAME%" status -bodyF %TEMP%\task.log

Open in new window


It could also help if you post your current script.
do i need to install anything?
what did is we use winscp to put some zip file to remote sftp site, we create a bat file to do the job, we use window sever 2003 task scheduler to schedule the job.


script looks like this below
@echo off
winscp.com /script=test.txt

exit

the test.txt will move those file to sftp site

thanks
You only need to download bat and put it in your path. Change the values in the script to match your email addresses, smtp servername, what you want your subject to be, etc.

@echo off
winscp.com /script=test.txt > %temp%\task.log
blat -server smtpservername-to address@yourdomain.com -f administrator@yourdomain.com -subject "task on %COMPUTERNAME%" status -bodyF %TEMP%\task.log
exit

Open in new window

i got server refused connection,
is it possible i can use sql server 2005 job  to search the task.log and send me an email with contents?
ASKER CERTIFIED SOLUTION
Avatar of tristonyip
tristonyip

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks