VB4, WIN95: Redirecting output of a shelled process 
Author Message
 VB4, WIN95: Redirecting output of a shelled process

I'd like to capture the output of a shelled program
(in this case UNZIP.EXE).  If I enter the following on
the command line, I get the desired results:

        c:\zip\unzip -l file.zip > c:\zip\tempfile

Namely, unzip prints a list of the files archived in
file.zip, and the output is redirected into a file
called tempfile in the same directory.

If I enter use the same command as an argument for the
Shell function, the file is not created.  Ditto if I use
the ExecCmd function created as described in Knowledge
Base Article ID Q129796, "How to Determine When a Shelled
32-bit Process Has Terminated" (I'm using unzip for Win32).
The unzip program does run.

I seek suggestions for how to make this work, including
suggestions for how I might better capture this output,
as text, in order to put the list into a List Box.



Tue, 20 Oct 1998 03:00:00 GMT  
 VB4, WIN95: Redirecting output of a shelled process


Quote:
>I'd like to capture the output of a shelled program
>(in this case UNZIP.EXE).  If I enter the following on
>the command line, I get the desired results:
>    c:\zip\unzip -l file.zip > c:\zip\tempfile

1. Try sticking it in a batch file!


allow you to call:




Wed, 21 Oct 1998 03:00:00 GMT  
 VB4, WIN95: Redirecting output of a shelled process


Quote:
>    c:\zip\unzip -l file.zip > c:\zip\tempfile
>If I enter use the same command as an argument for the
>Shell function, the file is not created.

I'm not sure about VB 4.0 and Win95, but using VB 3.0 and Win3.1x, you have
to do this:

shell("c:\command.com /c c:\zip\unzip -l file.zip >c:\zip\tempfile")


--
VB 3.0 and Win3.1x assumed

http://www.sn.no/~balchen/
ftp://ftp.sn.no/user/balchen/



Thu, 22 Oct 1998 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. VB4 - problem creating text from redirected output of shell command

2. Redirected Output From DOS Shell In Visual Basic 6

3. shell with dos tool output redirected to a file

4. Please help: redirecting output of shell started program

5. Probs with redirecting output of a shell started DOS-App to a file

6. redirect output of program run with shell command

7. Redirecting output from a SHELLed DOS Box

8. Redirecting output with Shell

9. Redirecting output in a shell (VB5)

10. using shell to exec dos app and redirect it's output

11. Shell redirect to standard output not working

12. capture output of shelled process

 

 
Powered by phpBB® Forum Software