It’s the little things…

Ever since I started working with console-based WSH scripts, I found the tendency to break input pipes if not launching explicitly with cscript to be a source of frustration and actual damage.

A few weeks ago, I started using “shadow scripts”: I would generate a CMD or BAT file with the same base name as a WSF, in the same folder, and give it the one line:

    @cscript "%~dpn0.wsf" %*

Although it was a little annoying to do at first, I found that I was suddenly writing more and more console scripts due to how simple use was. It makes calling and piping ten times easier.

Leave a Reply

Your email address will not be published. Required fields are marked *