LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

launchexecutableex with command line parameters

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?

0 Kudos
Message 1 of 7
(5,173 Views)

LaunchExecutableEx () requires three parameters not just one... maybe you can try LaunchExecutable ( )

0 Kudos
Message 2 of 7
(5,163 Views)

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?

0 Kudos
Message 3 of 7
(5,131 Views)

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

0 Kudos
Message 4 of 7
(5,128 Views)

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.

Additional Information

Library: Utility Library

Include file: utility.h

LabWindows/CVI compatibility: LabWindows/CVI 3.0 and later

0 Kudos
Message 5 of 7
(5,118 Views)

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

0 Kudos
Message 6 of 7
(5,111 Views)

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

0 Kudos
Message 7 of 7
(5,109 Views)