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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run on Server at specific time

Status
Not open for further replies.

firsttube

Technical User
Apr 21, 2004
165
CA
I have a vb script that I want to run on a server everyday at a specific time. Is this possible with vbscript? if so, how would one go about doing this?

thanks
ft


Information is not Knowledge, Knowledge is not Wisdom, Wisdom is not Truth, Truth is not Beauty, Beauty is not Love, Love is not Music, Music is the best.
 
I generally put them into the windows scheduler or AT schedule.

I have also found thaat when putting them into the windows scheduler it is best to run them from cmd(batch) files.

ie.
runme-11pm-nightly.cmd
cscript //nologo [Path to File] myvbscriptfile.vbs

Hope this helps.

Thanks

John Fuhrman
Titan Global Services
 
There is no was for a VBS file to execute itself. You will need to schedule it, as sparkbyte suggested.

Hope This Helps,

Good Luck!
 
Here is some code that might help you, a way to create a scheduled task via script.


Code:
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set objNewJob = objWMIService.Get("Win32_ScheduledJob")

errJobCreated = objNewJob.Create _
    ("Notepad.exe", "********123000.000000-420", _
        True , 1 OR 4 OR 16, , , JobID) 
Wscript.Echo errJobCreated

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top