Discovering Paths

Find out how CleanCache.pl discovers the paths to cached data.

Dave Roth

October 5, 2003

1 Min Read
ITPro Today logo in a gray background | ITPro Today

Each user has a dedicated profile directory. This profile contains user-account information that's specific to that user (e.g., Internet bookmarks, registry hive, Recent File List, My Documents list, program settings). Typically, the profile directory is a subdirectory of C:documents and settings and is identified by the user's user ID. For example, a user with the user ID Ralph would have the profile C:documents and settingsralph. However, the assumption that this user's Recent Documents directory would be C:documents and settingsralphrecent might not be correct. For example, if the user has a roaming profile, the profile directory might be \profile_serverusersralph.

Windows has a special function, SHGetFolderPath(), to discover the path to directories such as Temporary Internet Files and Recent File List. When you call this function, you need to pass in a folder value, called a class identifier (CLSID), that identifies the directory you're looking up. More information about these CLSID values is available at http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/reference/enums/csidl.asp.

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like