View Single Post
Old 01-11-2013, 09:12 PM   PM User | #8
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,210
Thanks: 59
Thanked 3,996 Times in 3,965 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Quote:
Originally Posted by felgall View Post
Those options run JScript though rather than JavaScript and the options available to use in the code are slightly different from what is available when you run JScript in a browser
100% agreed. But this was clearly what the original poster was looking for.

It's trivial to schedule a JS script with the Windows Task Scheduler in this way.

On two different sites that I manage, we use exactly this to perform various database cleanup and setup tasks. Some tasks run once a day, at night. Others run once an hour during the day. And all are more complex than I would care to try to do using a stored procedure, since they involve multiple steps that depend on each other. It is *SO* much easier to use a scripting language for this than it would be to do any other way.

It's really no different than using CRON and a shell script on Linux. Which I have done many times before, also. But the Windows command language is just nowhere near as rich as, say, C-shell on Linux. So we need something more powerful, and JScript fills the bill very nicely. It's even easier to understand then some of the arcane structures needed in shell scripts.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote