Jump to content

Problem with StdoutRead


Jango
 Share

Recommended Posts

Hello,

I'm using PSFTP.EXE to send/receive files to/from SFTP Server and i would like to show the result in a window but it does'nt work, here is my code:

Func SFTP_Execute($sHOST, $sPORT, $sUSER, $sPWD, $sFILE)
    Local $stdout, $rc
;InputBox("", "", "PSFTP " & $sHOST & " -P " & $sPORT & " -l " & $sUSER & " -pw " & $sPWD)
    $rc = Run("PSFTP " & $sHOST & " -P " & $sPORT & " -l " & $sUSER & " -pw " & $sPWD & " -b " & $sFILE, @ScriptDir, @SW_HIDE, $STDOUT_CHILD)
    While ProcessExists($rc)
        If StdoutRead($rc, 0, True) > 0 Then
            $stdout &= StdoutRead($rc)
        EndIf
        Sleep(1000)
    WEnd
    If StdoutRead($rc, 0, True) > 0 Then
        $stdout &= StdoutRead($rc)
    EndIf
    Return $stdout
EndFunc

What's wrong with StdoutRead ?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...