Windows batch file comment

broken image
broken image

echo WScript.Sleep 3000 > %temp%\sleep.vbs & cscript %temp%\sleep.vbs %sleepMs% //B & del %temp%\sleep.vbs The script does the sleeping for you (for 3 seconds in this example). Here's a one liner, to create a temp script, execute it, then delete it.

broken image

Using the technique illustrated here, you can mix the two (not 'seamlessly', but 'functionally'.). Often VBS can do things that batch cannot, or at the very least do so with drastically more ease. The basis of this solution has all sorts of application beyond this. After that, I agree that the ping 'kludge' is perhaps the next best option, as it is very simple. But as noted in the comments, that's not always an option (e.g.

Disclaimer: this is not the 'ideal' solution, so don't bother beating me over the head with that like done to those recommending ping.