Originally Posted by felgall
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.