Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Launching vb scripts via the AT Scheduler

Status
Not open for further replies.

mapman04

IS-IT--Management
Mar 28, 2002
158
US
What is the trick to launching vb scripts from the AT Scheduler? I have tried several different approaches and nothing seems to work. I've tried calling it from a BAT file and using CMD /C in the AT Scheduler. Can they be launched using the AT Scheduler?

Thanks,

mapman04
 
at 20:55 "wscript test.vbs"

or

at 20:55 "cscript test.vbs"

Regards
Steve Friday
 
It appears that the scheduler runs the task, but I don't get the result of the script. Here's what the schedule log shows:

"At1.job" (Wscript)
Started 1/28/03 4:28:00 PM

The script I'm trying to run checks the disk space on the C:\ drive of a NT Server. If it goes below a certain point, it sends me an e-mail. For testing, I'm just having it send the e-mail. The script works if you launch it from a command prompt.

Here's the script code:

dim oSession, oMessage, oAttachment, oRecipient, strSubject, strText, strFname, strLoc
dim sTo,inp01,txt01,inp02,name1,name2

sTo = "SMTP:user@somecompany.com"
strSubject = "Test of AT Scheduler"
strText = "The e-mail automation process was successful!" & vbCr & vbCr & _
"This messages was generated by a vbScript at: " & Now() & vbCr & vbCr & "Sys Admin"
set oSession=CreateObject("MAPI.Session")
oSession.Logon "User"
set oMessage=oSession.Outbox.Messages.Add(strSubject,strText)
set oRecipient=oMessage.Recipients.Add(,sTo)
oRecipient.Resolve
oMessage.Send
oSession.Logoff
set oSession=nothing

WScript.quit

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top