Why does the SHGetFolderPath API work with the CSIDL_COMMON_Documents constant on all operating systems including

all versions of 2000, XP Pro, XP Home, VISTA

and does not work on Windows Server 2003.

On Windows Server 2003 SHGetFolderPath used with CSIDL_COMMON_DOCUMENTS is unable to locate this standard windows system folder which actually maps to

c:\documetns and settings\all users\documents

I don't know if this is the correct forum for this but I am not sure where else to put this question. Our application uses this constant along with SHGetFolderPath to store our machine wide database and init files for our application.

Re: Architecture General CSIDL_COMMON_DOCUMENtS windows server 2003

Ollie Riches

If you want an answer to this you are probably best asking Raymond Chen at his 'The Old New Thing' blog. His blog and book contain all kinds of interesting and weird things about the windows platform.


The book makes a good read if you are interested in windows.


Ollie Riches

Re: Architecture General CSIDL_COMMON_DOCUMENtS windows server 2003

Mr. Bungle

The following code worked for me on Windows Server 2003 SP1 and SP2:

#include "stdafx.h"
#include <shlobj.h>
#include <iostream>

using namespace std;

int _tmain(int argc, _TCHAR* argv[])

wcout << szPath << endl;

return 0;

This returned 'C:\Documents and Settings\All Users\Documents' for both:

Windows Version 5.2 (Build 3790.srv03_sp2_gdr.070304-2240 : Service Pack 2) which has %SystemRoot%\System32\SHLWAPI.DLL v.6.0.3790.3959)


Windows Version 5.2 (Build 3790.srv03_sp1_gdr.070304-2232 : Service Pack 1) which has %SystemRoot%\System32\SHLWAPI.DLL v.6.0.3790.2954)