Passing values into and out of Command Line application *and* command line prompt in vbscript 
Author Message
 Passing values into and out of Command Line application *and* command line prompt in vbscript

      All,

      Question 1

      I've read that it is possible to, within a script, call a command line
executable, such as tracert.exe, passing it arguments, and retrieiving out
put.  I've attempted this using RUN as well as the shell object's stdin and
stdout.

      Any recommendations on docs and or source?

      Question 2

      Is there a way in VBScript, as in Perl prompt, to present a question
to the user and return keystrokes at the command line, sans input box?

      Any recommendations on docs and/or source would be appreciated.

      Thanks,

      P



Fri, 28 Jun 2002 03:00:00 GMT  
 Passing values into and out of Command Line application *and* command line prompt in vbscript
See embedded replies marked with "===>"

--
Michael Harris



      All,

      Question 1

      I've read that it is possible to, within a script, call a command line
executable, such as tracert.exe, passing it arguments, and retrieiving out
put.  I've attempted this using RUN as well as the shell object's stdin and
stdout.

===> you need to use shell.run but build a command line like
shell.run "%comspec% /c tracert.exe > drive:\path\capture.txt",0,true

This runs the program under the command processor (0 means in a hidden window,
true means wait on return) so that you can redirect the output to a text file.
Now you can open and parse the contents of capture.txt using fso
(FileSystemObject) methods.

      Any recommendations on docs and or source?

===> See:
VBScript Documentation (includes fso)
http://msdn.microsoft.com/scripting/vbscript/techinfo/vbsdocs.htm

WSH Documentation (for Shell object)
http://msdn.microsoft.com/scripting/windowshost/docs/reference/defaul...

(sorry for the long URLs ;-)...

      Question 2

      Is there a way in vbscript, as in Perl prompt, to present a question
to the user and return keystrokes at the command line, sans input box?

===> As of WSH 2.0, you can (when running under cscript.exe) write to StdOut and
read from StdIn (as textstreams).

      Any recommendations on docs and/or source would be appreciated.

===> See the WSH docs above...

      Thanks,

      P



Fri, 28 Jun 2002 03:00:00 GMT  
 Passing values into and out of Command Line application *and* command line prompt in vbscript


Fri, 19 Jun 1992 00:00:00 GMT  
 Passing values into and out of Command Line application *and* command line prompt in vbscript
Paul V. You are a saint.
thanks.


Quote:
> I've written the attached text file (save as .vbs and run in cscript) as a
> simple sample of input and output methods.

> Paul V.



Mon, 01 Jul 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Scripting command line applications & Command Line Prompting

2. Passing values from vbscript wsh to command line/DOS

3. pass command line argument value to a function?

4. passing values from .vbs file to command line under WSH

5. How to execute a command line command from a *.HTA

6. Sleep command and running a command line in VBScript

7. use the result of the VBS for other application under the command line

8. Passing Xoffset and Yoffset on command line (GhostScript)

9. Passing params to driver from Ghostscript command line

10. Passing Command Line Variables

11. Script running a passed command line.

12. how to pass "" to command line

 

 
Powered by phpBB® Forum Software