Save Time and Errors running CScript
This isn't Visual Basic, but ...
Since the About Visual Basic web site has been featuring a lot of VBScript articles recently, here's a tip that you might really like to see about DOS.
Microsoft recommends that you should run most of their ADSI and WMI VBScripts in a DOS command window using CScript. The reason is that when you execute a WScript.Echo command in Windows, it creates a new window to display the ouput every time. If you run a script that produces a lot of output, you can lock up your machine with thousands of individual windows sooooo bad !!!! I've been tempted to kick the plug out of the wall when it has happened to me.
But to do that, you usually have to navigate to the correct directory to execute your script command. If you're in, for example, "C:\Documents and Settings\Dan\My Documents" and your script is in "C:\Programming Tests\Visual Basic\Scripting Stuff\Scriptomatic" then you have to CD (Change Directory) up to the root and CD all the way back down to the Scriptomatic directory. Because "long file names" are usually used (for you young whippersnappers, old time programmers used to have to think up unique eight character names for EVERY file and directory), this can be a lot of typing and a lot of mistakes.
CD \
CD Programming Tests
CD Visual Basic
and so forth. (I know you could enter it all in one command, but that doesn't actually save many keystrokes and increases the chance of an error.)
Here's a tip ... just use the wild card with the CD command. If the part you do enter is unique, then you've got it.
So ... instead of ...
CD Programming Tests
... enter ...
CD Pro*
It saves me a lot of time when I'm running VBScripts!


Comments
Your 8 character comment reminded me of even farther back in time, when I was coding by hand with a pencil and paper, in HEX. Then there were those lilac and grey Octal bootstrapping switches . . .
I’m an old git
There are a few of us around. I’ve watched people enter bootstrap programs using console switches in binary, but I was just a junior programmer at the time and I was lucky that they didn’t chase me out of the machine room.
Thanks for the comment!
Something that helps a lot, that was also “borrowed” from Linux, is filename completion. After typing the first character or two of a directory, press TAB to have the shell try to complete it. If it picks the wrong one, keep pressing TAB until it gets the one you want.
Wow! The original blog was written three years ago, but people keep reading it!
I never knew about John Price’s trick! Thanks.