WshShell.WshSpecialFolders

Obtain the full path to any of the special Windows folders.

Syntax 
      strMyPath = WshShell.SpecialFolders("strFolderName")
      or
      strMyPath = WshShell.SpecialFolders.Item("strFolderName")

Arguments:

   strFolderName : One of the following special folders 
                   (as provided with the Windows 95 and 
                   Windows NT 4.0)

      AllUsersDesktop
      AllUsersStartMenu
      AllUsersPrograms
      AllUsersStartup
      Desktop
      Favorites
      Fonts
      MyDocuments
      NetHood
      PrintHood
      Programs
      Recent
      SendTo
      StartMenu
      Startup
      Templates

Returns:
   strMyPath : The full path to the special folder
               returns NULL if the folder is not available.

Examples

' Return the full path to the Windows Desktop
Set WshShell = Wscript.CreateObject("Wscript.Shell")
StrMyDesktop = WshShell.SpecialFolders("Desktop")
MsgBox StrMyDesktop

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

Related commands:


Equivalent Windows NT command:



Back to the Top

Simon Sheppard
SS64.com