capturing ouput of a DOS program 
Author Message
 capturing ouput of a DOS program

I am trying to run PKUNZIP with the -v option to get a list of the
contents, and capture the list to display in a listbox/textbox.

When I run the command "pkunzip -v test.zip > test.txt" at the DOS
prompt, the output is redirected to test.txt and the text file is
saved.

When I run the command "pkunzip -v test.zip > test.txt" with WinExec
the text file is NOT saved.

Anyone know how to redirect DOS output and get it into Windows?

Thanks...Brad
--

--
File Navigator For Windows 1.2 now available for download.
HTTP://www.{*filter*}us.ca/~bclarke/filenavw.html for more info.



Sun, 17 Jan 1999 03:00:00 GMT  
 capturing ouput of a DOS program

Quote:

> I am trying to run PKUNZIP with the -v option to get a list of the
> contents, and capture the list to display in a listbox/textbox.

> When I run the command "pkunzip -v test.zip > test.txt" at the DOS
> prompt, the output is redirected to test.txt and the text file is
> saved.

> When I run the command "pkunzip -v test.zip > test.txt" with WinExec
> the text file is NOT saved.

> Anyone know how to redirect DOS output and get it into Windows?

I responded to this exact question not too long ago.  The solution is
described in detail in "Tip 12: Redirecting the Output of a Shelled DOS
Program".  

Basically you need to do the following:

1) Programatically write a batch file to the disk that contains the text
"pkunzip -v test.zip > test.txt".
2) Use Shell on the batch file
3) Wait for the process to complete.
4) Read the results.
5) Delete both files.

It works anyway...

Geoff
====================================
      "I brake for MCSD's..."
------------------------------------
The Knowledge Base is YOUR FRIEND!!!
    http://www.microsoft.com/kb/
====================================



Mon, 18 Jan 1999 03:00:00 GMT  
 capturing ouput of a DOS program


Quote:
>When I run the command "pkunzip -v test.zip > test.txt" at the DOS
>prompt, the output is redirected to test.txt and the text file is
>saved.
>When I run the command "pkunzip -v test.zip > test.txt" with WinExec
>the text file is NOT saved.
>Anyone know how to redirect DOS output and get it into Windows?

I may have the syntax slightly off, but try

x% = Shell("command.com /c pkunzip -v test.zip > test.txt")

  -- Robert



Tue, 19 Jan 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. How to Capture Dos Output in VB4 Program (HELP)

2. Capturing output from a shelled MS-DOS program

3. Capture output a DOS based program?

4. How To Capture Dos Output Without Opening Dos Window

5. Launching Windows Program from DOS Program

6. VB6 program becomes a DOS program when compiling

7. Converting a DOS program to a WINDOWS program

8. About executing DOS programs in a VB program...

9. HELP!. Communication between DOS programs and VB programs

10. Execute DOS program from VB program

11. Execute DOS program from VB program

12. VB6 program becomes a DOS program when compiling

 

 
Powered by phpBB® Forum Software