LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing command line arguements to executable

I know how to do this. My question is why this has to be enabled in the build settings. There must be a good reason for it to not be enabled by default.

 

The application I wrote takes a config.ini file as a command line argument. Using the Windows file explorer, I can drag and drop the .ini file onto the application and the app runs, using that .ini file. Prior to setting the 'Pass all command line arguments to application' switch in the build settings, when I dropped a .ini file on my app icon in the File Explorer, the app would open and the .ini file would open in my text editor (notepad).

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

Hi Les,

 

There must be a good reason for it to not be enabled by default.

I guess it's because you (usually) create executables designed for a GUI with LabVIEW. When you want to use features of (basic, old fashioned) command line tools you need to enable them…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(3,029 Views)

Relatively very few programs out there actually do use the command line arguments.  So why add the extra overhead if 99% of the programs don't need it?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 5
(3,009 Views)

@crossrulz wrote:

Relatively very few programs out there actually do use the command line arguments.  So why add the extra overhead if 99% of the programs don't need it?


I agree that very few programs use it. Does it really add overhead? And why the unexpected behavior I described?

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

Seems expected to me.  What would happen if you put C:\myapp c:\config.ini into a command line if your app did not accept arguments.  Well, then that is two different applications trying to open.  What is the default program to open an ini file with?  Notepad.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 5
(2,991 Views)