07-23-2008 08:24 AM
07-23-2008 08:32 AM
Hi shb,
you can use the "current vi´s path" and build the correct path to your vi.
Mike
07-23-2008 08:54 AM
Hi Mike,
I would like to kow the path where the executable is STARTED in.
Example:
I open a shell and type "cd C:\Data"
I am in "C:\Daten" now
Now I execute: "C:\Program Files\MyProgram\Run.exe" My.png
The absolute path to the VI is "C:\Data\My.png" and not C:\Program Files\MyProgram\My.png"
How can the executable know that it was started in "C:\Data"?
Greetings,
shb
07-23-2008 09:07 AM
shb,
Look at this thread and my AppPath.vi (picture and vi included in the thread): http://forums.ni.com/ni/board/message?board.id=170&message.id=292248#M292248
-cb
07-23-2008 09:17 AM
07-23-2008 09:28 AM - edited 07-23-2008 09:30 AM
There's an Application class property called Directory Path which does what you want, but I would advise working with the method mentioned before.
You should also look at the rest of that thread, for a better solution:

However, the better solution in your case would be to do no work at all. If you search Google you should already find a program named LVDiff which does exactly what you want. I don't use it exactly as released, but I don't remember the exact changes I made. If you can't find it, search Sourceforge or the LAVA forums.
07-23-2008 09:38 AM
Ah, I see I midunderstood the question. I would still suggest using the existing LVDiff, but to do what you want in Windows you can call the system exec VI and pass it the command "cmd %cd%". That returns the %CD% environment variable which should be what you want.
07-23-2008 09:55 AM