LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

relative path to user desktop

Is there a way to create a relative path to the desktop folder for several users?  I'm generating an executable to go on a couple test laptops with different user accounts, want to write data to a file on the desktop in each case.  (Windows XP)
 
Thanks.
 
Jesse
0 Kudos
Message 1 of 13
(11,354 Views)
    Jesse,

Will you be saving the exe to the same location on each machine?  If so, you could use the "Current VI's Path" constant and then build/strip paths accordingly to hit the desktop. 

Jim
0 Kudos
Message 2 of 13
(11,352 Views)

Jim,

Actually, that's what I've got in place now, LOL...just seems rather "unelegant" and was hoping there was a better way.

Thanks.

0 Kudos
Message 3 of 13
(11,343 Views)
I know what you mean.  I'm not aware of a slicker way off hand.

Best of luck.
0 Kudos
Message 4 of 13
(11,340 Views)
    One additional thought I had.  If you were to use the Property Node for the App Instance and pull out the username (Windows) and also the LabVIEW directory path, you could then use build/strip paths to get to the desktop.  Pretty much the same as before, only it doesn't require you to install the application in the same location on every computer.

Best of luck.
Message 5 of 13
(11,311 Views)
Thanks
 
Jesse
0 Kudos
Message 6 of 13
(11,306 Views)
Are you trying to save the file so that all users can see the file, or are you trying to save the file to the Desktop folder for the particular user running the app? For the former, you can just write the file to the "C:\Documents and Settings\All Users\Desktop". For a specific user, replace "All Users" with the login name, which you can get from the username property as Jim mentioned.
0 Kudos
Message 7 of 13
(11,302 Views)

For the particular user.

Thanks.

0 Kudos
Message 8 of 13
(11,297 Views)
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
Jarrod S.
National Instruments
Message 9 of 13
(11,280 Views)

Thanks.

Jesse

0 Kudos
Message 10 of 13
(11,270 Views)