LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Launching command line compiler

I would like to use Launchexecutable to launch the command line compiler. When I try this is seems like the compiler starts up, but the parameters are not getting passed. (the project to compile)

 

to simplify I put the project in the same directory and the command.exe program:

 

This works when I run it on windows using the command line utility "RUN":

 

"C:\Program Files\National Instruments\CVI71\compile" "autogen.prj"

 

However these do not work:

            LaunchExecutableEx("""C:\\Program Files\\National Instruments\\CVI71\\compile"" ""C:\\Program Files\\National Instruments\\CVI71\\autogen.prj""",LE_SHOWNORMAL,&handle);
            LaunchExecutable("""C:\\Program Files\\National Instruments\\CVI71\\compile"" ""C:\\Program Files\\National Instruments\\CVI71\\autogen.prj""");
            LaunchExecutable("C:\\Program Files\\National Instruments\\CVI71\\compile autogen.prj");
            LaunchExecutable("""C:\\Program Files\\National Instruments\\CVI71\\compile"" ""autogen.prj""");

0 Kudos
Message 1 of 4
(3,424 Views)

in order to help debugging this: write a simple executable that accepts and display the command line parameters. something like:

 

int main( int argc, char *argv )

{

    printf( "%i arguments passed:\n", argc );

    for ( i = 0; i < argc; i++ )

        printf( "%i: {%s}", i, argv[i] );

    return 0;

}

 

now use LaunchExecutable to run the resulting exe and see what it is receiving as parameters. it should give you a hint on what's going on with your call.

0 Kudos
Message 2 of 4
(3,395 Views)

Have you tried using:

 

    LaunchExecutable("cmd /c C:\\Program Files\\National Instruments\\CVI71\\compile autogen.prj"); 

 

JR

0 Kudos
Message 3 of 4
(3,365 Views)

Or try:

 

LaunchExecutableEx("\"C:\\Program Files\\National Instruments\\CVI71\\compile\" \"C:\\Program Files\\National Instruments\\CVI71\\autogen.prj\"",LE_SHOWNORMAL,&handle);

 

(i.e Use a backslash to escape a double-quote within your string.)

 

Mert A.

National Instruments

0 Kudos
Message 4 of 4
(3,354 Views)