Support
10-10-2002, 04:52 PM
<HTML><HEAD><TITLE>INFO: Finding Shell Folders in the Registry</TITLE></HEAD><BODY><h3>INFO: Finding Shell Folders in the Registry</h3><b>Document ID: IR02021</b><hr>The information in this article applies to:<ul><li>Setup Factory 6.0</li></ul><hr><h3>SUMMARY</h3><p>This article provides information on finding shell folders in the Registry.</p><h3>DISCUSSION</h3><p>There are many "special" folders in Windows that are used by many different applications, but their locations on the system may be different from computer to computer and user to user. These folders are called "shell folders". An example of a shell folder is the "My Documents" folder.</p><p>The "User Shell Folders" and "Shell Folders" Registry keys generally hold the paths to shell folders for the current user of the computer. These Registry keys can be found in these locations in the Registry: </p><ul><li>HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Explorer\User Shell Folders</li><li>HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Explorer\Shell Folders</li><li>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr entVersion\Explorer\User Shell Folders</li><li>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr entVersion\Explorer\Shell Folders</li></ul><p>The shell folders found in HKCU (HKEY_CURRENT_USER) are generally specific to the current user, and those found in HKLM (HKEY_LOCAL_MACHINE) are generally for the "All Users" profile.</p><p>Entries in "HKCU\...\User Shell Folders" will be used by the operating system before entries in "HKLM\...\User Shell Folders". Entries in "Users Shell Folders" will be used before entries in "Shell Folders".</p><p>On Windows NT based operating systems (Windows NT 4.0, 2000, XP) entries in "User Shell Folders" will usually have corresponding values in "Shell Folders". Entries in "User Shell Folders" will generally have values similar to: "%USERPROFILE%\Desktop". The corresponding values in "Shell Folders" will have the "%USERPROFILE%" portion of their values expanded when the system boots.</p><p>On Windows NT based operating systems it is recommended that you read shell folders from "User Shell Folders" using the <b>Read from Registry</b> action, with the <b>Auto-expand if value of type REG_EXPAND_SZ</b> option selected. This will automatically expand any values like %USERPROFILE% or %SYSTEMROOT%.</p><p>On Windows 9x based operating systems (Windows 95, 98, ME) "User Shell Folders" is generally not used as much as "Shell Folders". You may find that most entries in "Shell Folders" may not be in "User Shell Folders".</p><p>On Windows 9x it is recommended that you read the shell folder information from "Shell Folders".</p><p>Here is a list of some of the available shell folders:</p><ul><li>AppData</li><li>Cache</li><li>Cookies</li><li>Desktop</li><li>Favorites</li><li>History</li><li>Local AppData</li><li>Local Settings</li><li>My Pictures</li><li>NetHood</li><li>Personal</li><li>PrintHood</li><li>Programs</li><li>Recent</li><li>SendTo</li><li>Start Menu</li><li>Startup</li><li>Templates</li></ul><p><b>Warning:</b> It is recommended that you do <b>NOT</b> edit the shell folders unless you know exactly what you are doing and the user has agreed to it. Editing these values can cause serious problems on the user's system.</p><p>Before reading a shell folder from the Registry look at the built-in variables available in Setup Factory 6.0 to see if your shell folder is already available. If it is, use the built-in variable instead of reading the value from the Registry. If you are going to read a shell folder from the registry be sure to test your setup (and what you read from the Registry) on all operating systems to make sure that it functions properly.</p><h3>MORE INFORMATION</h3><p>For more information please visit the following sources:</p><li>The topic <b>Command Reference | Variables | Built-in Variables</b> in the Setup Factory 6.0 help file.</li><li>The topic <b>Command Reference | Actions | Individual Actions | Read from Registry</b> in the Setup Factory 6.0 help file.</li><p>KEYWORDS: Setup Factory 6.0, Shell Folders</p><hr><FONT SIZE=1>Last reviewed: October 10, 2002<br>Copyright © 2002 <A HREF="http://www.indigorose.com" target="blank">Indigo Rose Corporation</a>. All rights reserved.<br></FONT></BODY></HTML>