The Item method is the default method of the WshSpecialFolders object. It takes a single argument of type Long, and returns the element in the collection at the specified position. Indexing starts at zero. If there is no element at the requested index, a "Subscript out of range" error is generated. A key string can also be used to access the items in the WshSpecialFolders. If key string is an invalid key, a NULL will be returned.
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).
WScript.Echo "The path to Desktop is: ",
WshSpecialFolder("Desktop")
WScript.Echo "The path to Desktop
is: ", WshSpecialFolder.Item("Desktop")C:\WINNT\Profile\User\Desktop
C:\WINNT\Profile\User\DesktopThis VBScript code displays the path to the special folder "Desktop". The example also illustrates both forms of syntax that can be used to call the default Item method.