LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

System command

Hi everyone,

 

I'm using "system" command to execute cmd.exe and a command bach.

i want to hide the cmd window when it's running.

is there any parametres to add to hide the cmd window using "system"?

thanks in advance.

0 Kudos
Message 1 of 5
(1,640 Views)

Use LauchExecutableEx() instead.

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 5
(1,585 Views)

Thnks @rolfk for the reply

But i want to use system command for two reasons :

-/ to avoid usig bat file, i want the command written directly in the code

-/ i want that to wait for the program to exit 

Is there any solution to make the cmd run in hidden mode?

0 Kudos
Message 3 of 5
(1,519 Views)

LaunchExecutableEx + ExecutableHasTerminated can be a solution for your second issue.

 

Regarding the first one, you started the discussion with "execute cmd.exe and a command batch", now you don't want to use a .bat file... can you explain exactly what you are trying to do?



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 4 of 5
(1,507 Views)

@Brainiac91 wrote:

Thnks @rolfk for the reply

But i want to use system command for two reasons :

-/ to avoid usig bat file, i want the command written directly in the code

Then prepend your commands with "cmd.exe". That is the command line application that implements the DOS compatible shell.

 

-/ i want that to wait for the program to exit 

Have you read the documentation for LaunchExecutableEx() documentation? It states explicitly that you can check on the status of the launched executable by calling ExecutableHasTerminated() on the handle that is returned (and that you always have to close the handle by calling RetireExecutableHandle() after you are done with it).

 

Is there any solution to make the cmd run in hidden mode?


Again read the documentation. The second parameter to LaunchExecutableEx() is a windowState which accepts one of the documented values. Quite likely the LE_HIDE might just do what you are talking about, but the naming could be of course just coincidence. 😁

Rolf Kalbermatter
My Blog
0 Kudos
Message 5 of 5
(1,502 Views)