In my never ending desire to use Batch files to do just about anything, I was recently needed batch file to send an email to users once task is completed with “Success” or “Failure” results. And since I was already using batch files to do number of things, I thought it wouldn’t harm if it can do one more thing …. send email to users !! Actually it is not possible to send email just from plain DOS commands so I added a bit flavor to it with use of good ‘ol VB Script. This distant cousin of batch script has always been popular among system admins, hackers and various other titles you can think of, due to its ability to access system level resources and more close ties to standard programing language VB.

I found over Google that most people suggest to use “CDO.Message” object to send email in VB Script. But there were not any “correct” script which solved my problem, it is because most of those scripts were required me to install SMPT server in my machine. But finally I was able to find a script which was doing exactly what it suppose to do (I honestly don’t remember which site was that because I had checked number of forums).

Finally working script is (with minor modification to original script),

More >