System.Shell.knownFolder Method
Returns an instance of a System.Shell.Folder based on a "well-known folder" name as defined within the user profile (for example, Documents or ProgramFiles).
Syntax
oKnownFolder = System.Shell.knownFolder(
strKnownFolderPath
)
Parameters
- strKnownFolderPath [in]
String The well-known name of a folder as a string. - oKnownFolder [out]
Object An instance of a System.Shell.Folder object that can be used with System.Shell.Item object methods.
Return Value
HRESULT
If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Remarks
The following are valid well-known folder names:
- Desktop
- Startup
- StartMenu
- Documents
- Programs
- CommonStartup
- CommonPrograms
- PublicDesktop
- PublicFavorites
- PublicDocuments
- System
- SystemX86
- Profile
- Windows
- Pictures
- Music
- Videos
- ProgramFiles
- ProgramFilesCommon
- ProgramFilesX86
- ProgramFilesCommonX86
- AdminTools
- CommonAdminTools
- PublicMusic
- PublicPictures
- PublicVideos
- UserProfiles
- Downloads
- PublicDownloads
- GadgetsUser
- RecycleBinFolder
Note Well-known names can vary between operating systems.
Requirements
Minimum supported client | Windows Vista |
Minimum supported server | Windows Server 2008 |
IDL | Sidebar.idl |
DLL | Sidebar.Exe version 1.00 or later |
See Also
Send comments about this topic to Microsoft
Build date: 2/24/2010
Build type: SDK