Jump to content

Run() Waiting until window is closed


Recommended Posts

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 by Socket1
Link to comment
Share on other sites

  • 11 months later...

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...