OBJECT:  WshSpecialFolders

The WshSpecialFolders object is a read-only collection object that contains all the special Windows folders such as the desktop folder, the Start Menu folder, and the personal document folder.

This object cannot be instantiated directly. It can only be accessed through the WshShell.SpecialFolders object.

As with all collection objects, the WshSpecialFolders collection can be iterated using the VBScript "For Each .. In" statement, but cannot be iterated using the JScript "for .. in" syntax.

PROPERTIES

length Property
The length property is read only and returns a Long value which is the number of items in the collection. For JScript consistency, length should be lowercase.

Syntax: object.length


 
METHODS

Count Method
The Count method returns a Long value which is the number of items in the collection.

Syntax: object.Count()

Item Method
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.

Syntax: object[.Item](lngIndex)
Or: object[.Item](strKey)


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