VB doesn't recocognise > (redirection) on command line 
Author Message
 VB doesn't recocognise > (redirection) on command line

I've tried to shell out to a program that runs in a dos box which produces
some text.  I wanted to capture the text into a file then parse  the file.
the code looks something like

cmdStr = "dig.exe ns co.uk > " & filenameStr
cmdOK = ExecCmd(cmdStr)

ExecCmd is a procedure that uses createprocess and waitforsingleobject
winapi functions to shell out.

The problem was the redirection was always ignored and output was still
displayed in the dos box.

dig.exe doesn't have any command line switches to redirect to a file.  had
to resort to creating a .bat with the cmdStr in it and used the batch file
name in the ExecCmd() procedure to run it.  seems a bit long winded.

rob mew




Tue, 06 Mar 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Command line redirection in PowerBASIC

2. Redirection of STDOUT and ERROUT in Command Line

3. new user-->>>How can i use existing exe's in vb

4. Help with Win 95 screen saver command line - command line.zip [1/1]

5. Query criteria >50 doesn't work if passed from form..;(

6. Executing command to command line from VB App

7. Multiline Textbox Cause Page Overflows when Printing or doesn't print all lines

8. Code doesn't work - just a few lines

9. When I merge 2 random access files the 2nd file doesn't line up correctly

10. Cross Tab doesn't put lines correctly

11. Text doesn't line up with Lexmark printer

12. fRefreshLinks Doesn't work if path doesn't exist

 

 
Powered by phpBB® Forum Software