Hi all - sorry if this is not the best group - if unsuitable, please advice where i should post. I have a situation where i need to scan the favourites folders for all users on a computer. I can't find a consistent way of enumerate these folders. I can get the favourites folder for the current user using SHGetFolderPath() but i don't no how to apply this to other users. I want to make the whole process as automated as possible. I know that on most machines these folders will always be in the same location but it can differ. Any suggested would be great. Mike C
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\<sid>\ProfileImagePath:REG_EXPAND_SZ: profile dir for user; Load user's hive from parameter above and check: HKEY_USERS\<sid>\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\Favorites:REG_EXPAND_SZ: favourites folder; Then just bind your IShellFolder interface to it or use FindFirstFile/FindNext File. Do not forget to unload user profile. You will need admin rights to run such program. "Mike Collins" <its@TheBottomOfThePost> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ: news:OsIUBBvDJHA.5316@TK2MSFTNGP04.phx.gbl... > Hi all - sorry if this is not the best group - if unsuitable, please advice > where i should post. > > I have a situation where i need to scan the favourites folders for all users > on a computer. > > I can't find a consistent way of enumerate these folders. > > I can get the favourites folder for the current user using SHGetFolderPath() > but i don't no how to apply this to other users. I want to make the whole > process as automated as possible. > > I know that on most machines these folders will always be in the same > location but it can differ. > > Any suggested would be great. > > Mike C
Mike Collins wrote: > Hi all - sorry if this is not the best group - if unsuitable, please advice > where i should post. > > I have a situation where i need to scan the favourites folders for all users > on a computer. > > I can't find a consistent way of enumerate these folders. > > I can get the favourites folder for the current user using SHGetFolderPath() > but i don't no how to apply this to other users. I want to make the whole > process as automated as possible. There is now safe way to access the data of any other user. There is no guarantee that their profile is accessible by your user, or even on the same machine in the case of roaming profiles. Further more, their HKEY_USERS branch won't be loaded unless they are currently logged in (or it failed to log out properly). You may be able to get around this using the ImpersonateUser APIs though. This is by design in Windows. -- Dean Earley (dean.earley@icode.co.uk) i-Catcher Development Team iCode Systems