abhi Posted May 1, 2007 Share Posted May 1, 2007 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 More sharing options...
Uten Posted May 2, 2007 Share Posted May 2, 2007 Does $var4 contain @comspec ? Also try to play with $STDERR_CHILD, $STDIN_CHILD & $STDOUT_CHILD. Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
abhi Posted May 2, 2007 Author Share Posted May 2, 2007 Does $var4 contain @comspec ?Also try to play with $STDERR_CHILD, $STDIN_CHILD & $STDOUT_CHILD.It does contain @Comspec. Link to comment Share on other sites More sharing options...
SkinnyWhiteGuy Posted May 2, 2007 Share Posted May 2, 2007 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. 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