WSH » WshEnvironment » length

Syntax:
object.Length

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.

Examples

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

This VBScript code uses the length property to report the number of system environment variables currently defined.

Language(s): VBScript

See Also: