The SpecialFolders property returns a WshSpecialFolders object

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")

發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 變更 )

Twitter picture

You are commenting using your Twitter account. Log Out / 變更 )

Facebook照片

You are commenting using your Facebook account. Log Out / 變更 )

Google+ photo

You are commenting using your Google+ account. Log Out / 變更 )

連結到 %s