LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting path of exe

Hello all,

 

I need small help. Please help me.

 

Currently I’m opening other “*.exe” with LabVIEW (System Exec.vi).

I’m passing exe path to System Exec.vi & It is working well.

 

The problem is, exe path is different in some of the user’s PC so, I’m getting error.

 

I want to find the path of exe from user’s PC before sending to System Exec.vi. Is there is any better idea for this?

I think, checking complete PC may take long time.

 

I have one more doubt, if I’m running same exe with “Run” command (without complete path), It is working (Example: AcroRd32.exe).

But, It is not working if I’m running same exe with System Exec.vi/Batch file.

I want to know how “Run” command is recognizing this exe path & how to extract the location.

Munna
0 Kudos
Message 1 of 8
(4,942 Views)

Also keep in mind the environmental variable thing. Is the path of the exe set in the PC?

Another issue can be this:

http://digital.ni.com/public.nsf/allkb/7B275F835074A31F8625788000569993

 

But usually I just distribute the required exe simply copying it to the Application Directory. Using the Application Directory path function in LV, I call the system exec.

0 Kudos
Message 2 of 8
(4,921 Views)

Dear Blokk,

 

Thanks for your reply.

 

Required exe is present in User’s PC but path is different from one user to other (C:\ or D:\).

I can’t copy required exe to LabVIEW Application Directory (Due to copyrights issue).

Munna
0 Kudos
Message 3 of 8
(4,913 Views)
Did the above link help?
0 Kudos
Message 4 of 8
(4,904 Views)

I tried but it is not working.

 

I'm getting below error:

'C:\Windows\Sysnative\AcroRd32.exe' is not recognized as an internal or external command,
operable program or batch file.

Munna
0 Kudos
Message 5 of 8
(4,895 Views)

Is it a x64 OS, and AcrobatReader installed?

0 Kudos
Message 6 of 8
(4,883 Views)

The link mentioned by Blokk solves problems if the executable is expected to be in the Windows system directory.

 

AcroRd32.exe is not located in the Windows system directory, but in an Adobe directory. For example on my PC C:\Program Files (x86)\Adobe\Reader 10.0\Reader\AcroRd32.exe, so the path C:\Windows\Sysnative\AcroRd32.exe doesn't exist at all.

 

Take a look at HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths in regedit.exe

I guess this is the place where the Run command finds executable files, if they reside in directories not included in the environment PATH variable.

 

If the location of the file is in the PATH, then it can be started via System Exec.vi. Otherwise you may look in the App Paths for it.

 

0 Kudos
Message 7 of 8
(4,874 Views)

Hi Munna,

 

when AcroRead is used as default PDF viewer you can start it by simply calling a PDF file of your own (and in a path controlled by you)…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 8
(4,868 Views)