LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do i find the current directory?

how do i let my labview EXE file know that the INI file it requires to start up is in the same directory as the EXE file?

That is, is there a similar function to the "Current VI's Path" that applies to the current EXE?

0 Kudos
Message 1 of 3
(3,144 Views)
There may be another way to do it, but Current VI's Path I think will return you the path to the VI *inside* the EXE, in which case you'll need to strip the path *twice* to get the path to the folder containing the EXE.  Somebody else can correct me if I'm wrong about this.  If this is right, then you'd need to read the App.Kind property in your diagram and use it to figure out if you need to strip the Current VI's Path once or twice.
 
Hope this makes sense,
-D
 
P.S. - I just had another idea...you can use the "Directory Path" property of the Application class...in the development environment, this property gives the path to the folder that contains your LabVIEW.exe file (like c:\Program Files\National Instruments\LabVIEW 8.0). Perhaps in an EXE it would give the path to the folder containing your EXE?

Message Edited by Darren on 01-26-2006 04:38 PM

0 Kudos
Message 2 of 3
(3,141 Views)
Darren is correct on both counts. However, since I want the functionality of reading the INI file to work when I develop my program in LV, getting the path to the LV directory is a bit of a problem. Over here you can find a simple example of a modified OpenG VI with some extra code which will return the path to the INI file whether you have a VI or an EXE. If the VI and the EXE have the same name, it can be the same INI file. It also returns the name of the main section. There are probably some more configurable ways to do this, but I found this works for me.

___________________
Try to take over the world!
Message 3 of 3
(3,129 Views)