System.Shell.Item.SHFolder property

[ 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. ]

Gets a System.Shell.Folder object from the System.Shell.Item.

This property is read-only.


objSHFolder = System.Shell.Item.SHFolder

Property value

System.Shell.Folder that represents the System.Shell.Item.


Useful for performing folder operations on a System.Shell.Item object that represents a system folder.

SHFolder does not get the parent folder of a System.Shell.Item that represents a file or link.


The following example demonstrates how to select a location, get a System.Shell.Folder object and create a new folder at that location.

// Member variables.
var oShellFolderItem;
var oShellFolder;

// --------------------------------------------------------------------
// Display the folder picker dialog and get a Shell.Item object 
// from the selection. A Shell folder object is also obtained.
// --------------------------------------------------------------------
function ChooseAFolder()
    oShellFolderItem = System.Shell.chooseFolder("SDK Choose Folder Example", 0);
    if (oShellFolderItem)
        spFeedback.innerHTML = + "<br/>";
        // Get a folder object from the System.Shell.Item.
        oShellFolder = oShellFolderItem.SHFolder;

// --------------------------------------------------------------------
// Create a new folder.
// folderName: the user specified folder name.
// --------------------------------------------------------------------
function CreateFolder(folderName)
    if (folderName)
        if (oShellFolder)
                spFolderFeedback.innerHTML = + " folder created.<br/>";
            catch (e)
                spFolderFeedback.innerHTML = e.description ;
                // Error handling.
            spFolderFeedback.innerHTML = "Unable to create folder. No location specified.<br/>Please select a parent folder.<br/>";


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
Sidebar.Exe (version 1.00 or later)