File paths
-
Whats going on with the file paths? I have the following two paths which I will expand.
"%USERPROFILE%\\Local Settings\\Temporary Internet Files\\" "%USERPROFILE%\\appdata\\local\\microsoft\\windows\\temporary internet files\\"
The first for XP the second for Vista. But, they both expand correctly AND I am able to open files using both ( in vista ). Looking in the %USERPROFILE% directory, I see the 'Local Settings' is a shortcut, to what exactly explorer doesn't show nor am I able to open it with explorer. This is causing havoc with my code since I am unable to easily distinguish which OS is being used. I'm guessing the 'Local Settings' points to the same folder and is there for backwards compatibility. If thats the case, then why bother changing the directory structure at all! -
Whats going on with the file paths? I have the following two paths which I will expand.
"%USERPROFILE%\\Local Settings\\Temporary Internet Files\\" "%USERPROFILE%\\appdata\\local\\microsoft\\windows\\temporary internet files\\"
The first for XP the second for Vista. But, they both expand correctly AND I am able to open files using both ( in vista ). Looking in the %USERPROFILE% directory, I see the 'Local Settings' is a shortcut, to what exactly explorer doesn't show nor am I able to open it with explorer. This is causing havoc with my code since I am unable to easily distinguish which OS is being used. I'm guessing the 'Local Settings' points to the same folder and is there for backwards compatibility. If thats the case, then why bother changing the directory structure at all!You shouldn't be hard-coding any of those paths, use
SHGetSpecialFolderPath()
to get a path. And useGetVersionEx()
to get the OS version. In Vista, MS shortened many pre-defined paths. Eg\Documents and Settings
is now\Users
. As for why this was done, I assume it was to avoid theMAX_PATH
limit. With virtualization, some files can get put in paths that are pretty long and many levels deep.--Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ Ford, what's this fish doing in my ear?