LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

+finding +executable +file +name

How can I find the name of the currently program executed ?
I want to disply file version and I must to have the name and path of the executable

Thank you a lot
0 Kudos
Message 1 of 5
(3,557 Views)
What executable do you need the name for? Are you launching an executable from your program? Do you want to just find the name of the program you built? Are you running multiple programs simultaneously?
J.R. Allen
0 Kudos
Message 2 of 5
(3,556 Views)
Hello,
I just want to know the name and path of the currently executable, I don't lauch any external program, only DLLs, one session at a time.
thank you for your response.

Thierry
0 Kudos
Message 3 of 5
(3,556 Views)
Every CVI program receives its own name in the first parameter of the main () function.
I store this name in a variable to display in the 'Info' panel, this way:

/****************************************************************************/
int main (int argc, char *argv[])
{
int nc, ctrl;
int tmpH = 0, error = 0;
char a[512];

if (InitCVIRTE (0, argv, 0) == 0)
return -1; /* out of memory */

//-----------------------------------------------------
// Initial operations
//-----------------------------------------------------
StringUpperCase (argv[0]);
strcpy (pgm, argv[0]);
if ((nc = FindPattern (pgm, 0, -1, ".", 0, 0)) > 0) pgm[nc] = 0; // Cut away the extension

...

Hope this helps
Roberto


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
(3,556 Views)
Is there a way to get the version info of an exe ?
(The version info will be set trough Target Settings >> Version Info )

thanks david
0 Kudos
Message 5 of 5
(3,556 Views)