Socket1 Posted October 9, 2009 Share Posted October 9, 2009 (edited) I'm using $handle = Run("command", "", @SW_HIDE, $STDOUT_CHILD) and then after it a sleep of 2 seconds and then code that reads the content of the command's stdout The command happens to be a putty/plink ssh window but it does not work the way its expected if I change @SW_HIDE to @SW_MAXIMIZED the command window shows up and only when I close it does the code to start reading the data come in. The documentation for the Run command says that "After running the requested program the script continues. To pause execution of the script until the spawned program has finished use the RunWait function instead." So what is going on? I've also tried @ComSpec & " /c command" and it still produces the same results. I can tell the SSH session is opened by the command because the logs show so so there should be at least the login message in the stdout buffer. Edited October 9, 2009 by Socket1 Link to comment Share on other sites More sharing options...
TurionAltec Posted October 9, 2009 Share Posted October 9, 2009 I don't think putty writes to stdout. Link to comment Share on other sites More sharing options...
mojomatt Posted October 1, 2010 Share Posted October 1, 2010 There is a known bug with PLINK.EXE. Adding the STDIN_CHILD opt flag in the RUN statement fixed this for me. 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