Find all Windows Shell Folder (Special Folder) Locations

Quick method to find the location of the current user’s special folders and return them in a dictionary keyed on the folder name.

Two ways below to enum all the shell folder registry keys. The for loop version shown is safer. The while components are there but commented out, just note that it relies on an exception error to indicate the end of the key has been reached, so there is a small chance that some unknown condition could cause it to never terminate, so the for loop is safer.

Example Output:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.