Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

System.Shell.knownFolderPath method

[ The Windows Gadget Platform/Sidebar is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions. ]

Retrieves a Known Folder Universal Naming Convention (UNC) path.

Syntax


strRetVal = System.Shell.knownFolderPath(
  strKnownFolderID
)

Parameters

strKnownFolderID [in]

String that specifies the Known Folder ID.

Note  For Windows 7, this method can accept a KNOWNFOLDERID globally unique identifier (GUID).

Return value

String that specifies the UNC path.

Remarks

strKnownFolderID represents the GUID that identifies standard folders registered with the system as Known Folders. These folders are installed with Windows Vista and later operating systems; a computer will only have the folders appropriate to it installed.

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 across operating systems.

Examples

The following example demonstrates how to retrieve the UNC path for a known folder.


// --------------------------------------------------------------------
// Display the UNC path of the Known Folder.
// txtKnownFolderID: the Known Folder GUID.
// --------------------------------------------------------------------
function GetKnownFolderPath(txtKnownFolderID)
{
    try
    {
        spFeedback.innerHTML = System.Shell.knownFolderPath(txtKnownFolderID) + "<br/>";
    }
    catch(e)
    {
        spFeedback.innerHTML = "Unable to retrieve path.<br/>";
    }
}

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

End of client support

Windows 7

End of server support

Windows Server 2008

IDL

Sidebar.idl

DLL

Sidebar.Exe (version 1.00 or later)

 

 

Community Additions

ADD
Show:
© 2015 Microsoft