Click to Rate and Give Feedback
MSDN
MSDN Library
User Interface
Gadgets
Windows Sidebar
System.Shell
Methods
 knownFolderPath Method

  Switch on low bandwidth view
knownFolderPath Method

[This documentation is preliminary and is subject to change.]

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

Syntax

strKnownFolderPath = System.Shell.knownFolderPath(strKnownFolderID)

Parameters

strKnownFolderID Required. 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.

Example

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/>";
    }
}

Applies To

System.Shell
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker