Click here to Skip to main content
13,093,097 members (68,707 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hi All,

I need to get the path of shared/public document in XP, vista and windows7.
please give me a code snapshot for this.

i am writing code in windows XP and the same code i want to run in xp, vista and windows7

Thanks in advance.
Posted 6-Apr-11 3:07am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1


See here for more CSIDLs:[^].

[Note: ignore the nonsense about SHGetFolderPath() being deprecated. If you follow the advice in MSDN, your app won't work on XP or earlier systems.]
SAKryukov 6-Apr-11 18:56pm
Correct (especially with the reference to the CLSID). My 5.
Obsolete SHGetFolderPath is a problem. What, is it invalid for Windows 7? Similar .NET GetFolderPath does work correctly on all systems I know...
Hans Dietrich 6-Apr-11 22:09pm
No, SHGetFolderPath works fine on Win7. It's the MS-recommended alternative that does not work prior to Vista.
SAKryukov 7-Apr-11 0:00am
Thank you for your answer, Hans. That's what I say: would require different code for XP and Windows 7. It's easy to implement but... just sad :=<.
Hans Dietrich 7-Apr-11 0:21am
It's sad, pathetic, idiotic. I run out of words to describe.
SAKryukov 7-Apr-11 0:37am
Must die.
Jayant Narayan Dash 7-Apr-11 1:32am
Thanks to all of you for your valuable reply...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.170813.1 | Last Updated 6 Apr 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100