Monday, August 27, 2007

call a page from vbscript

call a page from vbscript
=========================


Sometimes you may be in a situation where you are required to call a webpage (intranet/www) via a vbscript running locally.

Eg: Suppose you want to send email attachment via asp but want to put it in a schedular. In this call you might write the emailing logic in a asp page and make the below vbscript and put it in a local schedular.(windows schedular)


Script to be written in a vbscript

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run("http://localhost/mywebpage/sendmail.asp")
set WshShell = Nothing



Alternate option is to write the logic in a oracle/ms sql server stored procedure and put it in a schedular / call the vbscript from oracle/sql server schedular.

No comments: