LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

relative path to user desktop



@jarrod S. wrote:
You'll have to call a win32 API function to get this information. Here's an example in LV85.




And I've reattached an example saved in LV80.

Message Edited by Jarrod S. on 05-06-2008 11:54 AM

Yes above is the only safe way!

You could start of from the LabVIEW data path, (property App.DefaultDataDir) which will be something like C:\Documents and Settings\<user>\My Documents\LabVIEW Data, strip of two levels and append "Desktop" to it. But this will of course only work on English Windows versions because of the "Desktop" name.

Rolf Kalbermatter


Message Edited by rolfk on 05-06-2008 11:08 PM
Rolf Kalbermatter
My Blog
0 Kudos
Message 11 of 13
(1,685 Views)

So in the end, the dumb work-around I started with doesn't work...

It works great on my development desktop, but in distributed applications the "Current VI's Path" returns both the name of the vi and the name of the executable in the path so to make it work in an .exe I'd have to strip it twice, which would cause, of course, a short path when just executing the vi.

Moving to the "right" solution now.

Jesse

0 Kudos
Message 12 of 13
(1,658 Views)

It works great on my development desktop, but in distributed applications the "Current VI's Path" returns both the name of the vi and the name of the executable in the path so to make it work in an .exe I'd have to strip it twice, which would cause, of course, a short path when just executing the vi.

This is by design. See here and here.
0 Kudos
Message 13 of 13
(1,650 Views)