Property:  WshShell.SpecialFolders

WshShell.SpecialFolders strFolderName

The SpecialFolders property returns a WshSpecialFolders object which can be used to access various Windows shell folders such as the desktop folder, the Start Menu folder and the personal document folder.

If strFolderName is unavailable, SpecialFolders returns NULL. The following is the list of available special folders on various Windows OS. (Note: not all of the following special folders are available to all flavors of Windows).
AllUsersDesktop
AllUsersStartMenu
AllUsersPrograms
AllUsersStartup
Desktop
Favorites
Fonts
MyDocuments
NetHood
PrintHood
Programs
Recent
SendTo
StartMenu
Startup
Templates
Code:
Set WshShell = WScript.CreateObject("WScript.Shell")
Set objWshSpecialFolders = WshShell.SpecialFolders
WSCript.Echo "My documents are in: " & objWshSpecialFolders("MyDocuments")
' Or to access the WshSpecialFolders object directly from the WshShell object
WSCript.Echo "My documents are in: " & WshShell.SpecialFolders("MyDocuments")


Output:
My documents are in: C:\WINNT\Profiles\theGuru\My Documents
My documents are in: C:\WINNT\Profiles\theGuru\My Documents

Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information