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

running vbs script using scheduled task

Status
Not open for further replies.

tpluskota

Technical User
Dec 11, 2002
121
GB
Im having a problem when im trying to run a vbs script using windows scheduled task, if I run the script by clicking on it it works however when I add it as a task in does nothing, I have checked all the security settings and they seem fine, I am running the task as an adinistrator. Any ideas??
 
Try running as your command:

"cscript.exe yourscript.vbs"

When you "click" on a .vbs, Windows associates it with cscript.exe much in the same fashion a .doc would open in Word. But when you schedule it, there is no link to the interpretter, in this case cscript.exe.

Also, consider using abosolute paths; ie "c:\windows\sytem32\cscript.exe c:\scripts\myvbs.vbs" as your command line.
 
If that doesn't work, try creating a batch file with the cscript command as shown by wallst32. Then execute the batch from your schedule.

Also, you may need to give additional rights to the Administrator account... Specifically "Log on as Batch" right.

PSC

Governments and corporations need people like you and me. We are samurai. The keyboard cowboys. And all those other people out there who have no idea what's going on are the cattle. Mooo! --Mr. The Plague, from the movie "Hackers
 
You should also check the log to see the task result or error code. You can view the log from the "Advanced" menu that appears for Scheduled Tasks or check the file SchedLgU.Txt in the Windows directory.

Sometimes it's the simple things - is the task scheduler service running? Pardon me if you already did check it but your post did not indicate it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top