03-24-2023 06:25 AM
Dear community,
I'd like to run a utility vi which is located inside a project from command line. After it run I'd like to terminate Labview and continue with my command line script. Since it is a utility vi, I don't want to generate an .exe from it, since that would mean much overhead.
Here is what I tried, this is inside my example_utility.vi:
This perfectly terminates the vi as well as Labview, when running directly from the project.
However when I open Labview from command line,
$ "LabVIEW.exe" "myProject.lvproj" "example_utility.vi"
the vi runs (as configured upon opening) and terminates but Labview remains open.
Do you have any idea how to quit Labview after the vi finished? Is it possible to call "Quit Labview" Node from command line? I am also open for ideas how to perform these steps from a python script, if there are more convenient possibilies.
My local machine has Windows 10 and I am using Labview2022Q3.
Looking forward to your advice,
best wishes
03-24-2023 06:58 AM
Hi maxine,
@maxine_mumann wrote:
Since it is a utility vi, I don't want to generate an .exe from it, since that would mean much overhead.
What exactly is the overhead in creating an executable from your VI(s)?
It seems less troublesome than starting/quitting LabVIEW each time you want to call this functionality within your batch file…
03-24-2023 07:51 AM
Dear GerdW,
thanks for your fast response. There are several of these utility.vi s in different labview projects and I would like to run them upon request.
We are some collaborating developers and when any utility.vi changes it would need a re-build of the respective .exe. Each utility vi needs a build specification, which in best case detects that a modification was done and triggers a re-build. Further this .exe needs to be deployed somewhere and fetched from the command line script. This seems to me quite some overhead.
Best wishes
03-24-2023 08:10 AM
Hi Maxine,
@maxine_mumann wrote:
- We are some collaborating developers and when any utility.vi changes it would need a re-build of the respective .exe.
- Each utility vi needs a build specification, which in best case detects that a modification was done and triggers a re-build.
- Further this .exe needs to be deployed somewhere and fetched from the command line script. This seems to me quite some overhead.
I still don't see the overhead (apart from running a pre-defined build spec)…
03-29-2023 02:03 AM
Hello GerdW,
thank you for your response. We have quite some difficulties to maintain this project, up to now we did not find a sufficticated way to maintain our project in terms of Package Manager or instant fetching dependencies. However, this is another question. I appreciate your advice to take another approach to complete the task, but it really seems too much overload for this project.
There is still the question left, why Labview VI 'Exit Labview" does not exit Labview, when the project and vi was started via command line? Do you know why that is and how to fix it?
Looking forward to your response. Best wishes
01-13-2026 10:37 AM
Did you ever get an answer? I've got something very similar going on.
The VI never finishes. I don't want to throw the nuclear "Quit LabVIEW" vi, as I will likely have other VIs running.
The next time i execute it, nothing happens, as if the orignial is still going...
Am I missing an INI setting or something?
01-13-2026 12:36 PM - edited 01-13-2026 12:38 PM
Even though the front panel is hidden, it is still open. Try closing it programmatically as the last thing the VI does. I think that setting the front panel to "hidden" opens the front panel explicitly so you have to close it explicitly.
01-13-2026 12:51 PM
What Bill said should work AND there is an easier way.
I highly recommend using G-CLI or LabVIEW-CLI (if you can't install vipm packages). It's designed specifically to call LV code from the CLI.
https://www.vipm.io/package/wiresmith_technology_lib_g_cli/
https://labviewwiki.org/wiki/NI_LabVIEW_Command_Line_Interface
Upthread someone mentioned building exes and that is also good but not always possible. Sometimes want things that are only accessible in the IDE.
01-13-2026 12:53 PM
oh and if you use either of those you'll probably want this package too. As they set the unattended flag which can cause some weird behaviour like file dialogs just simply not showing up.
https://www.vipm.io/package/felipefoz_lib_enable_lv_dialogs/
If you encountered weird behaviour with file dialogs, just run this from the tools menu and try again.
01-13-2026 01:28 PM - edited 01-13-2026 01:38 PM
That did it.
I changed the call to,
as you mentioned. It didn't like being run hidden. I then just called a vanilla
And that took care of it.
Thanks again. I've always had the devil running VIs in Hidden state.. and your explanation makes perfect sense.