From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how was the EXE launched?

Solved!
Go to solution

Hi all,

 

This is a Windows question : is there a way to know from within my app (when it runs as an EXE) if it was launched by the user (clic on the EXE file) or if the app was lauched by the OS because it is in the startup?

 

Thanks in advance for any help


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 1 of 5
(2,685 Views)

Why not ask a car question while you are at it?  😉

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 5
(2,680 Views)
Solution
Accepted by topic author TiTou

I don't know if there is, but you could probably configure the shortcut to pass an argument as part of the call and then check in your code whether you receive it or not. I don't like this because it relies on a hidden configuration in the shortcut, so I would probably prefer a bat file rather than a shortcut.


___________________
Try to take over the world!
Message 3 of 5
(2,668 Views)

It makes sense! Thanks for the batch + argument idea.


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 4 of 5
(2,663 Views)

@tst wrote:

I don't know if there is, but you could probably configure the shortcut to pass an argument as part of the call and then check in your code whether you receive it or not. I don't like this because it relies on a hidden configuration in the shortcut, so I would probably prefer a bat file rather than a shortcut.


It's possible to do something similar to this without modifying your LabVIEW code - if you look in task manager, under processes - there is a column (hidden by default) called 'command line' - it shows the command line arguments that were passed to the application when it was launched. If you set your 'start up' application to launch with a command line (e.g. using a shortcut / batch file) you can then see this in the task manager.

 

You can probably get the command line arguments of another process using the .NET process library.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 5 of 5
(2,632 Views)