Jump to content

ProcessExists ?


Recommended Posts

All,

I am trying to launch a .BAT file from an autoit exec(the autoit exec itself is being launched from a Java program) in the following manner

$var4 designates the BAT file I want to invoke and

$var5 designates the log file where I want to route the BAT file generated stdout

...

$pid=Run($var4 & " >> " & $var5 & " 2>&1","",@SW_HIDE)

...

I want the autoit exec to wait until the called BAT file finishes execution. I understand RunWait() is meant exactly for that. However when I use RunWait() instead of Run(), the output never gets routed to the log file

..

RunWait($var4 & " >> " & $var5 & " 2>&1","",@SW_HIDE)

..

Consequently I have tried to use Run() and ProcessExists() such that I pass the PID returned by Run to ProcessExist()

I was hoping that ProcessExists might do the trick but unfortunately it results in the same. Log file not getting any output :">

Any suggestions would be appreciated.

Thanks

Link to comment
Share on other sites

Does $var4 contain @comspec ?

Also try to play with $STDERR_CHILD, $STDIN_CHILD & $STDOUT_CHILD.

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