05-23-2014 12:02 PM
I am trying to launch an batch file with command line parameters
launchexecutableex("C:\\mybatch.bat 10 2")
the batch file returns an error. If I run the batch from a windows shortcut with the same parameters it functions correctly. Any suggestions?
05-23-2014 11:43 PM
LaunchExecutableEx () requires three parameters not just one... maybe you can try LaunchExecutable ( )
05-27-2014 05:43 AM
I left out thehandle in the example, I found the problem is in the RetireExecutableHandle (int executableHandle) function. I have it in a loop to check to see if the process terminates. While in this loop the .exe I am running is very slow to respond. Normally it takes 10 seconds to run, while in the loop it takes around 60+ seconds to run. Any suggestions?
05-27-2014 06:01 AM
If you want to determine if your executable has terminated you should call
terminated = ExecutableHasTerminated ( executableHandle );
I don't see how you can find out about your process using RetireExecutableHandle...
05-27-2014 08:20 AM
when the .exe completes it updates a log file. The function returns a zero if it is still running or a 1 when complete. Once complete I check the log file. When I keep this function in a loop it slows the .exe process down to a crawl.
Determines whether an application started with LaunchExecutableEx has terminated.
Library: Utility Library
Include file: utility.h
LabWindows/CVI compatibility: LabWindows/CVI 3.0 and later
05-27-2014 09:08 AM
'Thanks' for posting fragments of the function help...
...but it would have been more useful to properly explain your question / problem which is not clear to me...
Initially you said that your batch file returns an error. You did not elaborate what your batch file is supposed to do, what the error message is or if it is an error message of CVI at all.
In your subsequent post you found the problem (of your batch file?) to be a function call of RetireExecutableHandle () ...; however, a slow response maybe a problem but is not an error...
Now you're posting help text of ExecutableHasTerminated, so what function are you using, ExecutableHasTerminated or RetireExecutableHandle? Why do you expect us having the second sight?
In any case calling a function in a loop takes cpu time - you might consider using a timer instead.
05-27-2014 09:45 AM
sorry, I have two issues and posted them in the wrong message. The first issue is the .bat file runs fine from a shortcut with two commandline parameters. When I run it using the system command it returns an error. The second issues is the launchexe issu.e