WSH » WshEnvironment » Count

Syntax:
object.Count ()

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

Examples

Code:
Set objShell = WScript.CreateObject("WScript.Shell")
Set objSysEnv = objShell.Environment("SYSTEM")
WScript.Echo("There are", objSysEnv.Count(), "System environment variables.")
Output:
There are 14 System environment variables.
Explanation:

This JScript code uses the Count method to report the number of system environment variables currently defined.

Language(s): JavaScript

See Also: