LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I need to find an exe file to run it from labview

how can I programmatically find an exe file on my computer so that I can run it.  My application wil only work if this other program is running, I can check to see if it is running, but if not, then I need to start it.  I know how to run the exe file if I know the path, but users can install software to any location, so I would not necessarily know where it is. Hence I need to be able to find the path of a known exe file.
0 Kudos
Message 1 of 16
(4,108 Views)
What operating system? If it's on Windows, and the program was installed using a standard installer, then that information would be in the registry in the HKLM\Software tree.
0 Kudos
Message 2 of 16
(4,101 Views)

Hi dylan,

                Right click the exe--->properties--->Find target will give you the file path.

0 Kudos
Message 3 of 16
(4,091 Views)
How can he "right-click and get the properties on the exe" if he doesn't know where the exe is?
Message 4 of 16
(4,088 Views)

Call tasklist.exe from the system exec and search for the app.exe you are looking for.  See below:

 

TASKLIST
Tasklist[.exe] [/s computer] [/u domain\user [/p password]] [/fo {TABLE|LIST|CSV}] [/nh] [/fi FilterName [/fi FilterName2 [ ... ]]] [/m [ModuleName] | /svc | /v]
Parameters
/f
Specifies that process(es) be forcefully terminated. This parameter is ignored for remote processes; all remote processes are forcefully terminated.
/fo {TABLE|LIST|CSV}
Specifies the format to use for the query output. Valid values are TABLE, LIST, and CSV. The default format for output is TABLE.
/im ImageName
Specifies the image name of the process to be terminated. Use the wildcard (*) to specify all image names.
/nh
Suppresses column header in output. Valid when the /fo parameter is set to TABLE or CSV.
/p Password
Specifies the password of the user account that is specified in the /u parameter.
/pid ProcessID
Specifies the process ID of the process to be terminated.
/s Computer
Specifies the name or IP address of a remote computer (do not use backslashes). The default is the local computer.
/t
Specifies to terminate all child processes along with the parent process, commonly known as a tree kill.
/u Domain\User
Runs the command with the account permissions of the user specified by User or Domain\User. The default is the permissions of the current logged on user on the computer issuing the command.
/v
Specifies that the output display verbose information.
/?
Displays help at the command prompt.
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 5 of 16
(4,084 Views)

That will simply indicate if the program is already running, and the user's statement "I can check to see if it is running" to me implies that they already know how to find out if it's running. Smiley Wink

 

His issue is to start the application if it's not running, but he doesn't necessarily know the path to the program because when this other program gets installed the user may have selected a non-default installation path, and he needs to know how to figure out what the path to the executable is in order to start it. This is no different than patching systems that need to determine where an application got installed. This information is in the registry assuming a standard installation program was used. 

0 Kudos
Message 6 of 16
(4,079 Views)
Sorry I misread and thought we needed to know if a particular exe is already running.  If that were the case the tasklsit is a quick method to find out. 
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 7 of 16
(4,051 Views)

How can he "right-click and get the properties on the exe" if he doesn't know where the exe is?
Opps i thought from a shortcut he needs to find the exe
0 Kudos
Message 8 of 16
(4,027 Views)

Does this exe have a data file linked to it?  Like VI is linked to LabVIEW.exe.

If it is, then you just need to create a dummy data file in this type at a known path.  Then open the data file.  Window will use the register exe to open it.

 

If not, you just have to do a search to find the exe.

 

 

George Zou

http://www.geocities.com/gzou999/

George Zou
0 Kudos
Message 9 of 16
(4,016 Views)

Thanks for your help, but although I have searched the registry, I cannot find the information (Path) I am looking for.  I am experienced in working with the registry, but I expected to ba able to find the path within it (Iknow where the file is on this machine) butr unfortunately I have been unable to do this. 

Any ideas/help would be appreciated

0 Kudos
Message 10 of 16
(3,969 Views)