LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Launching an executable with parameters

How do I launch an executable from CVI with passing a parameter? LaunchExecutableEx() does not work neither system(). I'd like to open the exe the same way i can do it by clicking "Start-Execute" and then for example writing the string "c:\sample.exe DOK-I".
0 Kudos
Message 1 of 7
(4,019 Views)
With ShellExecute
0 Kudos
Message 2 of 7
(4,008 Views)
system(), LaunchExecutable(), and LaunchExecutableEx() all pass command line parameters, for example:
system ("notepad myfile.txt");
launches notepad and opens a file named myfile.txt.
system ("notepad /p myfile.txt");
launches notepad and prints a file named myfile.txt.

See the attached project.
0 Kudos
Message 3 of 7
(3,992 Views)
hello

I'm a new user of CVI and I've exactly the same question.


I would like to launch an executable over TCPIP with system exec command line for example:
my_application.exe c:\temp\source.txt c:\temp\target.txt

How can I handle with this?

thanks a lot


0 Kudos
Message 4 of 7
(3,820 Views)
Are you looking to do this via a telnet session or in some other way? TCP/IP is a transport protocol and not any sort of shell interface. Telnet, FTP, and a whole bunch of other things run on top of TCP/IP which merely provides a reliable (in theory) transport of packets from one machine to another.
 
Conceivably, you could create a server application to run on the remote machine to launch the program for you, but if a telnet server is available on that machine, it may be easier to use that service to open a shell terminal and do whatever you want to do.
Martin Fredrickson
Test Engineer

Northrop Grumman
Advanced Systems and Products
San Diego, CA 92128
0 Kudos
Message 5 of 7
(3,810 Views)
I don't know at this time how I will do that.
As there is a labview program which runs on this computer, I 've only to use another loop to listen on TCP  port and execute my application when the correct command is received.
 
 
My executable with parameters problem is solved.
 
Thanks
0 Kudos
Message 6 of 7
(3,808 Views)

So if you already have a program that is sending a command message over a TCP/IP link, then you need to do a couple of things. First the program that is sending needs to know where to send it, what IP address and what port number. Second, you need something at the other end to receive that message. That program needs to listen at the same port, decode the message to determine if it is the right one and then launch your program.

I believe there is an example of how to implement a TCP/IP server and client in the example code that ships with CVI. That should be a good place to start with creating the server to listen for the message.

 

Martin Fredrickson
Test Engineer

Northrop Grumman
Advanced Systems and Products
San Diego, CA 92128
0 Kudos
Message 7 of 7
(3,803 Views)