LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Closing labview from command line

Solved!
Go to solution

Hi all,

 

I was wondering if there is a way to close the LabVIEW.exe from the command line. I came accross the taskkill command but also i found that it doesn't close the application properly and may later on lead to LabVIEW crash.

 

Why I want to do this is because I am developing an application which needs LV 10.0 to be running on the computer. So it will check which LV version is running and if it is not 10.0 it has to close the LabVIEW.exe and open the 10.0 version of LabVIEW.exe. 

 

Now I know how to open LabVIEW.exe using System exec.vi  but can anyone tell me how to close LabVIEW.exe using the same.

 

P.S: I can't use the Quit LabVIEW function as well because it will close my application.exe itself.:(


Warm Regards,

Nitzz 

0 Kudos
Message 1 of 6
(4,992 Views)

Does this thread help?

http://forums.ni.com/t5/LabVIEW/How-to-close-running-applications-listed-in-Application-tab-of/m-p/1...

 

Perhaps you could look for LabVIEW.exe in task manager (assuming you're on Windows) and end it that way using in the windows utilities?

 

Ian

Message 2 of 6
(4,981 Views)

Hi Ian,


Thanks for the reply. I downloaded the vis attached in that thread but i was not able to open it. Anyway, I think that's the primitive version of the Quit LabVIEW tool which will exit the Application.exe as well. I guess I'll have to go ahead with the taskkill command in the Windows command line. Though I am not sure about the ill effects of using this command.:)


Thankful Regards,

Nitzz 

0 Kudos
Message 3 of 6
(4,978 Views)

Using VI server you could bring the application to the front, the you could send a Ctrl+Q using the Windows user32.dll.

I didn't try it, so I don't know if this will work.

To send Ctrl+Q press Ctrl, then press q, release q, release Ctrl. A VI that wraps the user32.dll call can be found here: http://forums.ni.com/ni/attachments/ni/170/401417/1/Simulate%20Keyboard%208.5.vi

To avoid a pop-up asking if you want to save unsaved VIs you might have to close them all first using VI server.

 

Message 4 of 6
(4,973 Views)
Solution
Accepted by topic author NitzZ

Hi Nitzz,

I see what you mean - I had a play and have pulled out the files that are relevant. I tried building an exe and it does indeed seem to close LabVIEW.exe leaving any compiled exes running , although if you have unsaved or running VIs, it will pop up user dialogs... might help though.

The top leve file you need to run is 'quit application.vi'... obviously running it in the development environment will end itself!

 

Good luck!

Ian

Message 5 of 6
(4,971 Views)

Hi Ian and dan,


Thank you both. Your posts helped me a lot..

 

Regards,

Nitzz 

0 Kudos
Message 6 of 6
(4,965 Views)