How Can I Change or Set the VI Search Path for LabVIEW Executables?

Updated Jan 12, 2023

Reported In

Software

  • LabVIEW Full
  • LabVIEW Base
  • LabVIEW Professional

Issue Details

The locations of some of the dependencies (VIs, DLLs, etc) for my executable have changed after deployment, or my LabVIEW-built executable cannot find some of its dependencies. How can I change or set the VI search path for my LabVIEW executable such that it can find these items?

Solution

With every LabVIEW executable you build, a corresponding .ini configuration file titled [Application Name].ini is created. This .ini file stores all the preference information for the executable. You can add the following token in the .ini file for your executable to set additional search paths:
viSearchPath=""
Note that the .ini file must also have a section header with the application name in it (e.g. [Application Name]). The following is an example entry for an .ini file created for an application titled MyApplication.exe
[MyApplication] 
viSearchPath="C:\Documents and Settings\Desktop\dll2\LabVIEW_code_and_DLL\*"
 

If you wish to add multiple search paths, the additional paths can be separated by using a semicolon. For example:
viSearchPath="<path 1>;<path 2>;<path 3>"

 

Additional Information

Asterisks (*) characters can be used to indicate a recursive search in that directory. 

This .ini token can be particularly useful for situations where an executable returnsError -21when a file cannot be found. Setting the search path to include the missing file(s) can be an easy way to troubleshoot the issue.