LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

launch executable with command line arguments

Cany anyone tell me how to launch an executable in command prompt using lab windows CVI?

0 Kudos
Message 1 of 6
(5,242 Views)

Have you tried searching the forum for an answer?

This question appeared several times before, refer to this thread for a solution.

 

0 Kudos
Message 2 of 6
(5,235 Views)

Can anyone tell me how to use LaunchExecutable()?? Somewhere it's given that include filename as parameter and somewhere to use  cmd.exe /c command args.

and in example its mention to use it like this: 

LaunchExecutable ("cmd.exe /c copy c:\\temp\\file.tmp c:\\tmp");

What shall I do in this case, kindly reply.

0 Kudos
Message 3 of 6
(5,189 Views)

As you can see in the help for the function:

If you need to execute a command built into cmd.exe, such as copy or dir, you can call LaunchExecutable with the following command:

cmd.exe /c command args

 

That is: is the program to execute a standalone executable? Then pass it directly to LaunchExecutable. Is it built into an interpreter? Then call the interpreter passing the command to execute as a parameter.

 

As per passing parameters or filenames or so to the command, it depends on the command itself and what you need to do with it. As an example, "dir" will output the folder content, but it is useless if launched this way if the output is not redirected somewhere (e.g. to a file) for further examination (it will briefly open an output window and close it immediately so you cannot see the result).



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 4 of 6
(5,183 Views)

I launched an executable successfully through command line. Now at the same time without exiting that executable i want to give power...so how will I do that?

0 Kudos
Message 5 of 6
(5,161 Views)

I don't know what exactly "give power" means, but LaunchExecutable is not stuck waiting for the external program to terminate: once launched the other application, your program continues running so you should be able to "give power", whatever this may imply.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 6 of 6
(5,156 Views)