Solution
There are two different methods for accessing the VI's current directory: the
Current VI's Path node and the
Application Directory node. The exact returned filepaths from these two functions vary based on the environment in which they're called.
- The Current VI's Path node returns the full path including the VI's name. This path varies based on whether the VI is running in the LabVIEW development environment or in a stand-alone application. LabVIEW wraps all VIs associated with a stand-alone application into an extra layer, which is actually the executable itself.
If you make a VI named Application.vi located in C:\, in the LabVIEW development environment, the Current VI's Path function will return C:\Application.vi. If you build the same VI into a stand-alone application named MyApplication.exe, then Current VI's Path will return C:\MyApplication.exe\Application.vi. - The Application Directory node returns the path to the folder or directory containing the VI when called in the development environment instead of the VI itself, and when called in a stand-alone application, the VI returns the path to the folder containing the stand-alone application rather than the VI that is under that application.
For a VI located in C:\, the Application Directory function simply returns C:\. You must use the Build Path function to append the application or VI name to the end of the path. You would append Application.vi to access the VI on the development environment and MyApplication.exe / Application.vi to access the VI on the stand-alone application.