LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

retrieve desktop path

Hi,

Does anyone know how to programmatically retrieve the current windows
desktop path ? I'm using LV 5.01 on a Windows PC.

Thanks - oz
0 Kudos
Message 1 of 6
(4,072 Views)
The path to your desktop is in the registry. You will find two paths one for all users and one for the current user. The keys are HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\ShellFolders or HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ShellFolders. Maybe on Win95, 98, 98SE the path is a little bit different. It coulde be also different if you have alternative desktops as e.g. Norton Desktop.
In LV5.0.1 you do not have VIs for registry access so I will give you mine. The documentation is small so if you need more send a email to waldemar@hersacher.de.
Waldemar
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
Message 2 of 6
(4,072 Views)
The Windows API has functions that allow you to get the location of many folders whose location may vary from Operating System to Operating System, or even from Machine to Machine! Like, if you hard code "C:\Windows\Desktop" for the Desktop Folder, the VI won't work on an NT or XP machine ("C:\Documents and Settings\\Desktop") nor on a PC where the user has reinstalled the system ("C:\WIN98\desktop"). I've got a VI that makes the necessary API calls named 'Get Folder Path.vi'. Included in the zip file is an Excel sheet that explains the constants to feed it to make it work! If you have any questions, email me or call me, my contact info is in the vi.
Message 3 of 6
(4,072 Views)
Hi John - the user is using ver 5, can you save for previous please? (I want to check it out with 6.0 as well)

Regards, Paul
0 Kudos
Message 4 of 6
(4,072 Views)
Yeah, I keep forgetting not everyone has the latest version. Sorry about that. By way of apology, here is a set of VIs that run the gamut from 5.0 thru 6.0.2 to the latest (6.1). I have included another vi that retrieves the Windows, System or Temp folder path by way of OLE Automation through the Windows Script Host Model.
0 Kudos
Message 5 of 6
(4,072 Views)
Paul S. commented that you only have Labview v5. I answered him with the same thing I'll answer you...here is the vi recompiled for Labview versions 5.0, 6.0.2 and 6.1; I also include a vi that uses OLE Automation to retrieve the path to the Windows, System or Temp folder via the Windows Script Host Model. Hope this helps!
0 Kudos
Message 6 of 6
(4,072 Views)