Xenobiologist Posted August 31, 2006 Share Posted August 31, 2006 HI, headline says it all. Example: #include <Constants.au3> Dim $text $stream = Run(@comspec & ' /c plink.exe -v hugo','',@SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) ; doens't work ; $stream = Run(@comspec & ' /c plink.exe -v ','',@SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) ; works ; $stream = Run(@comspec & ' /c plink.exe ','',@SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) , works While 1 $textline = StdoutRead($stream) $text = $text & @CRLF & $textline If @error Then ExitLoop Wend MsgBox(0, "STDOUT read:", $text) So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Xenobiologist Posted September 1, 2006 Author Share Posted September 1, 2006 Hi, nobody using plink? Nobody any idea? pipe to file - doesn't work. So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
lod3n Posted September 3, 2006 Share Posted September 3, 2006 Remove this part: "$STDERR_CHILD + " [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] Link to comment Share on other sites More sharing options...
Wibble Posted November 21, 2006 Share Posted November 21, 2006 I've got plink working as a call from AutoIT - and can read it's output.First problem you have might be with the plink setup.You also need pageant and puttygenIt's better to use sshplink -v hugoisn't actually doing a lot - just getting verbose messages'hugo' (in your case) is actually getting the PuTTY session, not the host. You need to setup ssh on your host, generate a SSH key and a passphrase for pageant. Pageant takes your passphrase (like your bank pin code) and then sends the more complex SSH keyCheck that you can then give a command likeplink -ssh hugo lsIf it asks you for your username, then you need to setup your username in a PuTTY sessionDim $sPlinkFullPath = '.....\plink.exe'RunWait($sPlinkFullPath & ' -ssh "hugo" "ls"',@SW_MAXIMIZE)should then get you the output of the 'ls' command for the specified account in PuTTY session 'hugo'.See the Plink/Putty documentation http://the.earth.li/~sgtatham/putty/0.58/htmldoc/Use Run with the options discussed previously to capture the output from the plink session.Now my problem:I'm using an AutoIt script to call some commands on a remote computer.The AutoIt script is itself called from another program.The plink works ok, but I need to capture the output and get it back to the program that called the AutoIt script, i.e. a pipe. Capturing the data is ok, but I'm having problems getting it back to the calling program. Any ideas? Link to comment Share on other sites More sharing options...
Xenobiologist Posted November 21, 2006 Author Share Posted November 21, 2006 Hi, you can write it to a file or send it via TCPSend. So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Wibble Posted November 22, 2006 Share Posted November 22, 2006 Stumbled on the ConsoleWrite/ConsoleWriteError functions. Worked ok sitting in a loop reading the output with StdoutRead and writing it using ConsoleWrite. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now