Quote Originally Posted by dilettante View Post
Here is an update to ShellPipe.

This is version 7 which optionally breaks out child process output, i.e. data written to StdOut and StdErr can be received separately by the parent program. There are also some minor bug fixes.

By default the new property ErrAsOut = True, making version 7 highly compatible with earlier versions. But when ErrAsOut = False several new events, methods, and properties prefixed ErrXXXX come into play.


The hardest part about dropping version 7 into a project previously using an earlier version is that the buffer class SmartBuffer was renamed as a more modest SPBuffer (in response to several snide remarks about the grandiose name). So to "upgrade" a Project you now need to copy the new files ShellPipe.ctl, ShellPipe.ctx, and SPBuffer.cls into the Project folder and also remove SmartBuffer.cls from the Project and add SPBuffer.cls to it instead.

So a .VBP beginning:

Code:
Type=Exe
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\..\..\..\..\..\..\Windows\system32\stdole2.tlb#OLE Automation
Form=Form1.frm
UserControl=ShellPipe.ctl
Class=SmartBuffer; SmartBuffer.cls
Becomes:

Code:
Type=Exe
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\..\Windows\system32\stdole2.tlb#OLE Automation
Form=Form1.frm
UserControl=ShellPipe.ctl
Class=SPBuffer; SPBuffer.cls
I hope you find it useful.

ShellPipe version 7 is attached here as a ZIP archive containing a very small VB6 Project that uses it. This Project just uses ShellPipe to run cscript.exe against a supplied script test.vbs, send some input to the script via StdIn and capture output from the script via the StdOut and StdErr streams.
cannot support this format command

With a Unicode string command

"adb. Exe exec - out screencap - p > c:\ 桌面\ShellPipe7\Simple\screen\screen.PNG"



Without a Unicode can perform in the CMD command can succeed

AppLocation = "adb.Exe exec - out screencap - p > d:\ShellPipe\Simple\screen\screen.PNG"

If SP.Run (appLocation) = SP_SUCCESS Then

Shown here successful command execution, but actually did not succeed can not pull png to my computer

End If

- for the following this way

AppLocation = Environ $(" COMSPEC ") & "/ Q"

If SP.Run (appLocation) = SP_SUCCESS Then

Call SP.Sendline(" adb.Exe exec - out screencap - p > d:\ShellPipe7\Simple\ screen\screen.PNG ") 'can be successful ,png on my computer

End If

----------------------


but

If SP.Run ("adb devices") = SP_SUCCESS Then

' this command work ok . why

End If



can help? thanks