05-21-2014 08:29 AM
A VI I'm working on stores a few controls in a .ini file and works a treat. I'm going to be turning the VI into an application and have it accessable on a few PCs by either copying the .exe and .ini over to the PCs or keeping it on a thumbdrive.
What I would like ideally is to have the VI look for the path in the same folder the application is stored in. So if I copy the folder over to a desktop or a thumbdrive, it wouldn't matter. What's the easiest way to do this?
Solved! Go to Solution.
05-21-2014 08:48 AM - edited 05-21-2014 08:50 AM
Application Directory function.
05-21-2014 08:49 AM
There is a function in the File IO->Path Constants palette called Application Directory. When in the development environment, it returns the folder of the project file. When in an application (exe), it returns the folder of the executable. Use this function with the Build Path to locate your ini file.
05-21-2014 08:56 AM - edited 05-21-2014 08:58 AM
Run this VI.
It correlates each of the path constants to the actual location it points to on your specific PC which will vary depending on your OS and who is logged in.
05-21-2014 10:13 AM
Thank you all. That's exactly what I was digging around trying to find.