Help. Almost every decent console tool has a command-line Help switchtypically /? or /hthat you can use to access information. In XP and Win2K, you can call up the general command-line Help with the following command at a command prompt:
HH ntcmds.chm
In addition, the CliWrapper class has a couple of helpful mechanisms. It has a Command property that lets you see your command the same way Windows sees it. If something isn't running as you expect, try using the following statement to see the command exactly as executed:
WScript. Echo console.command
In addition, you can echo the script's error output using
WScript. Echo console.stderr
Finally, you can instantly reuse the console object by simply calling console.exec with a new command string. You don't need to add another New statement because the console will automatically clean up its old output each time it's called.
The Right Tool for the Task
The CliWrapper class makes console-application-output capture simple by hiding complex implementation concerns. We haven't addressed an important question, however: Is hiding these concerns a good thing to do? Obviously, the WSH designers thought so because in WSH 5.6, WScript.Shell's Exec method provides some support for this approach. . . .
ajrushin August 10, 2004 (Article Rating: