LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

copy file to desktop

Solved!
Go to solution
How can i copy a file to Desktop? How to find the pathname to users Desktop (multi-language)? is there a special variable like %USERPROFILE%?
0 Kudos
Message 1 of 5
(4,076 Views)
Solution
Accepted by topic author karpa

To get the desktop location use the Windows API SHGetKnownFolderPath or SHGetFolderPath as described in this thread. The names of the paths you can retrieve (like Desktop, AppData, My Documents etc are listed here.)

 

--Ian

0 Kudos
Message 2 of 5
(4,068 Views)

so i dit try the suggested sollution but is producing an error.. 

#include <shlobj.h> 

...

SHGetFolderPath (0, CSIDL_DESKTOP, NULL, SHGFP_TYPE_CURRENT, path); 

 

  link Error: Undefined symbol '_SHGetFolderPathA@20' referenced in "launchexe.c".

i used it inside launche.exe example 

win XP cvi 8.5 

 

 

 

 

 

 

 

Message Edited by karpa on 01-02-2010 09:36 AM
0 Kudos
Message 3 of 5
(4,057 Views)
Have you added Shell32.lib to your project?


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 5
(4,043 Views)

 I added the lib from an older project of mine, i changed it with the one from cvi sdk and everything works now!

Thanks!!

0 Kudos
Message 5 of 5
(4,032 Views)