The Count method returns a Long value which is the number of items in the collection.
Set objShell =
WScript.CreateObject("WScript.Shell")
Set objSysEnv =
objShell.Environment("SYSTEM")
WScript.Echo("There are",
objSysEnv.Count(), "System environment variables.")There are 14 System environment
variables.This JScript code uses the Count method to report the number of system environment variables currently defined.