I know everybody hates JScript, but I write a ton of quick-and-dirty mini-apps – sometimes as straight .js, sometimes as .hta (gasp) – to automate tasks (especially screen-scrapers – they’re fast).

Anyway, a little trick for executing VBS functions from JScript (most are allowed natively, but some aren’t – e.g., sleep).

Basic idea is:

1. Create an instance of scripting.filesystemobject.
2. Create a textfile and write VBS commands to it.
3. Create an instance of wscript.shell.
4. Use the run method to execute the .vbs

You can use this same technique with .bats (or just about anything).