WshSpecialFolders.Item

The Item property returns the full path for the special folder specified by strFolderName. It is the default property.

Syntax

WshShell.SpecialFolders.Item("strFolderName") = strFolderPath
WshShell.SpecialFolders("strFolderName") = strFolderPath
 

Remarks

WshShell.SpecialFolders("strFolderName") returns NULL if the requested folder (strFolderName) is not available. For example, Windows 95 does not have an AllUsersDesktop folder and returns NULL if strFolderName = AllUsersDesktop

The following special folders are provided with the Windows 95 and Windows NT 4.0 operating systems:

AllUsersDesktop

AllUsersStartMenu

AllUsersPrograms

AllUsersStartup

Desktop

Favorites

Fonts

MyDocuments

NetHood

PrintHood

Programs

Recent

SendTo

StartMenu

Startup

Templates

Example

' This fragment returns the full path for the Windows Desktop folder
  Set WshShell = Wscript.CreateObject("Wscript.Shell")
  StrMyDesktop = WshShell.SpecialFolders("Desktop")

' List all special folders
  For Each strFolder In WshShell.SpecialFolders
    MsgBox strFolder
  Next

See Also

WshShell.SpecialFolders property