WSH » WshSpecialFolders » Count

Syntax:
object.Count (())

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

Examples

Code:
Set WshShell = WScript.CreateObject("WScript.Shell")
Set WshSpecialFolders = WshShell.SpecialFolders
intNum = WshSpecialFolders.Count
WScript.Echo "There are ", intNum, " Special Folders on this machine."
Output:
There are 18 Special Folders on this machine.
Explanation:

This VBScript code uses the Count method to retrieve the number of special folders found on the current system.

Language(s): VBScript