Sign in to follow this  
Followers 0
abhi

ProcessExists ?

4 posts in this topic

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

Share this post


Link to post
Share on other sites



Does $var4 contain @comspec ?

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

It does contain @Comspec.

Share this post


Link to post
Share on other sites

I've used ProcessWaitClose before, logging the output just as you do, and it works, try to pass the return from the Run statement to it, and use ProcessWaitClose to pause until it's done.

Share this post


Link to post
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
Sign in to follow this  
Followers 0