
Probs with redirecting output of a shell started DOS-App to a file
Michael,
If you want to use redirection of the console output, you
need to shell to the command processor:
"c:\windows\command.com " or Environ$("comspec")
Or, try writing a batch file and shelling that.
For the hat trick, if you want to get the <STDOUT> into
a text box then go here:
http://{*filter*}net.pair.com/ and download the "clipboarddos"
utilites. The program "clipcopy" will allow redirection via pipe to
the clipboard. Then you can use the clipboard.settext method
from VB to fill the textbox.
HTH, Mark
Quote:
>Hi out there & please help again....
>while developing a small depacker shell, I encounter Probs with redirecting
>output of a shell started DOS-App to a file. It seems imposible to get it
>done with the following code:
>_____________________________________________________
>Private Sub btnZipTest_Click()
> Dim RetVal
> Dim i As Integer
> strUnzip = "pkunzip -t " & strArchivName & " >e:\hallo\report.txt"
> RetVal = Shell(strUnzip, 1) ' Extract Files
> AppActivate RetVal, True
>End Sub
>_____________________________________________________
>The code works so far, opens a shell and tests an archive with pkunzip, but
>does not create a file "report.txt" in the chosen directory.
>When opening a shell and typing "pkunzip -t test.zip >report.txt", the file
>is created - why not while opening the Shell under VB?!
>Anyone a better idea on how to get the output of pkunzip to a file, or
>better - into a TextBox?
>Any help appreciated!