I'm looking for a Windows variable (accessible in c++) that contains the path to a user's my documents folder in XP, but the folder above that in vista.
SO in
XP: C:\Documents and Settings\Tom\My Documents
Vista: C:\Users\Tom

It is a program (AIM specifically), which uses this variable the directory and I'm having a hard time figuring out what it is..

Recommended Answers

All 2 Replies

It doesnt nececerially have to use a variable. Windows vista (when UAC is on) does File/Folder redirection so any hardcoded references to My Documents are redirected to /users/username.

ok thats helpful.

except what do you mean by "hardcoded"? if I wanted to access the file that was in either my documents or userprofile (depending on the operating system), I could just use %USERPROFILE%\My Documents, and vista would redirect to just %USERPROFILE%?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.