I just use :
This will actually write to APPDATA with the permissions already set for sharing.
char * safePath = new char[MAX_PATH]; GetEnvironmentVariable ("ALLUSERSPROFILE", safePath, MAX_PATH);
This will actually write to APPDATA with the permissions already set for sharing.