System Scripting Runtime 1.5

This software adheres to the terms of FREEWARE.

Permission is hereby granted for this archive to be distributed via BBS, WWW, Anonymous FTP and any other means as long as no fee is charged for distribution and all components of this archive remain together.

 

The System Scripting Runtime in its current form is a module which contains six ActiveX components: IPNetwork, LMNetwork, NBTNetwork, SNMPManager, SSHSupport and System. It was designed and implemented to provide system and network-related functionality for various development environments (Scripting Languages, VB, C++, etc.).

What's New

Installation

Programmer's Reference

Providing Feedback

Technical Support


What's New

Version 1.5 -/- 2007-07-24: Version 1.4 -/- 2001-12-29: Version 1.3 -/- 1999-09-22: Version 1.2 -/- 1999-06-01: Version 1.1 -/- 1999-02-18:

The following new properties/methods have been added to the System object


Installation

Prerequisites:

Installing the Product
To install the product, copy SScrRun.dll to a directory of your choice and execute the command
"RegSvr32.exe SScrRun.dll".

If the system is running Windows NT 4.0 SP3+ / 2000 / 2003 / XP and you want to generate SNMP traps with the GenerateTrap method of the SNMPManager object, you must also register the STGenExt.dll module. To do this,  copy STGenExt.dll to a directory of your choice and execute the command "RegSvr32.exe STGenExt.dll". Please note that you must be an administrator to successfully register the STGenExt.dll module. You must stop and start the SNMP service after registering the STGenExt.dll module to activate this module.

Uninstalling the Product
To uninstall the product, execute the command "RegSvr32.exe /u SScrRun.dll".

To deregister the STGenExt.dll module, execute the command "RegSvr32.exe /u STGenExt.dll".


Programmer's Reference

Objects:


IPNetwork Object

 

ProgID SScripting.IPNetwork
File name SScrRun.dll
CLSID 2B6A6DD3-8D36-11D2-8D8F-00A024D26D2E
IID 2B6A6DD2-8D36-11D2-8D8F-00A024D26D2E

Properties

Type Access
Hostname String Read-only
Domain String Read-only

Methods

Name Parameters
DNSLookup Host as String
DNSLookupEx Host as String
Ping Destination as String,
(optional) ResponseTime as Variant,
(optional) SourceOfResponse as Variant,
(optional) Timeout as Long,
(optional) TTL as Long,
(optional) BufferSize as Long
SendSyslogMessage Destination as String,
MessageText as String,
(optional) Facility as Long,
(optional) Priority as Long,
(optional) DestinationPort as Long

Hostname Property (IPNetwork Object)

The Hostname property returns the hostname of the local host. Read-only.


oIPNetwork.Hostname

Data Type

String

Remarks

(none)


Domain Property (IPNetwork Object)

The Domain property returns the DNS domain name of the local host. Read-only.


oIPNetwork.Domain
 

Data Type

String

Remarks

(none)


DNSLookup Method (IPNetwork Object)

The DNSLookup method resolves the name of a host to its IP-address or the IP-address of a host to its name (reverse-lookup).


String = oIPNetwork.DNSLookup( Host )
 

Parameters

Host as String
String containing the name or the IP-address of the host to be resolved.

Return Value

If the method succeeds, the return value is the first IP-address of the host, if the name of the host was provided as the Host parameter, or the name of the host, if the IP-address of the host was provided as the Host parameter. If the method fails, the return value is the empty string ("").

Remarks

Please note that DNSLookup will only return the first IP-address of a host. If you want to retrieve all IP-addresses of a multi-homed host you have to use the DNSLookupEx method.


DNSLookupEx Method (IPNetwork Object)

The DNSLookupEx method resolves the name of a host to its IP-addresses or the IP-address of a host to its names (reverse-lookup).


StringArray = oIPNetwork.DNSLookupEx( Host )
 

Parameters

Host as String
String containing the name or the IP-address of the host to be resolved.

Return Value

If the method succeeds, the return value is a string array containing all IP-addresses of the host, if the name of the host was provided as the Host parameter, or a string array containing the official hostname and all alternate names, if the IP-address of the host was provided as the Host parameter. If the method fails, the return value is an empty string array.

Remarks

(none)


Ping Method (IPNetwork Object)

The Ping method sends an ICMP echo request to the specified host and returns information about the response, if one is received.


Long =
 oIPNetwork.Ping(
    Destination,
    ResponseTime,
    SourceOfResponse,
    Timeout,
    TTL,
    BufferSize
  )
 
 

Parameters

Destination as String
String containing the name or the IP-address of the host to ping.
 
(optional) ResponseTime as Variant
A Variant variable of sub-type Long which returns the number of milliseconds passed between sending the echo request and receiving the response. The variable will only hold a value if the method returns sscPingSuccess (=0), sscPingDestinationUnreachable (=10) or sscPingTimeExceeded (=20).
 
(optional) SourceOfResponse as Variant
A Variant variable of sub-type String which returns the IP-address from which the received response was sent. The variable will only hold a value if the method returns sscPingSuccess (=0), sscPingDestinationUnreachable (=10) or sscPingTimeExceeded (=20).
 
(optional) Timeout as Long
Number of milliseconds the method will wait for a response before it returns with sscPingTimeout (=30). If this parameter is not specified, a timeout value of 1000 milliseconds will be used.
 
(optional) TTL as Long
Time-to-Live (1-255) value of the echo request packet. If this parameter is not specified, the system default value (NT 4.0: 128) will be used.
 
(optional) BufferSize as Long
Size in bytes (1 - 64000) of dummy data to be contained in the echo request packet. If this parameter is not specified, a buffer size of 32 will be used.

Return Value

The method returns one of the following result codes:

Result Code Description
sscPingSuccess = 0 A valid ICMP Echo Response packet has been received.
sscPingDestinationUnreachable = 10 An ICMP Destination Unreachable packet has been received.
sscPingTimeExceeded = 20 An ICMP Time Exceeded packet has been received, which may be caused by a TTL value being too small.
sscPingTimeout = 30 No response has been received within the timeout period.
sscPingInvalidParameter = 100 On or more of the provided parameters contain an invalid value.
sscPingSocketError = 110 An WinSocket related error occurred.
sscPingInvalidHostAddress = 120 The specified host address (hostname or IP-address) is invalid.

Remarks

The response time is accurate to 10 milliseconds. This means that if the response time returned is 0, as many as 9 milliseconds may have passed.

The ping method uses the raw sockets feature of WinSock 2.x. On Windows NT 4.0 SP4+ and Windows 2000, the use of raw sockets is limited to administrators. This default behavior can be changed in case of Windows NT 4.0 but not in case of Windows 2000. More information can be found in KB-Article Q195445.


SendSyslogMessage Method (IPNetwork Object)

The SendSyslogMessage method sends a syslog message to the specified destination host.


Long =
 oIPNetwork.SendSyslogMessage(
    Destination,
    MessageText,
    Facility,
    Priority,
    DestinationPort
  )
 
 

Parameters

Destination as String
String containing the name or the IP-address of the host to send the syslog message to.
 
MessageText as String
String (1 - 1024 characters) containing the message text to send.
 
(optional) Facility as Long
Value specifying the facility of the syslog message. It can be one of the following constants:
sscFacilityKernel (=0)
sscFacilityUser
(=1)
sscFacilityMail
(=2)
sscFacilityDaemon
(=3)
sscFacilitySecAuth
(=4)
sscFacilitySyslog
(=5)
sscFacilityLpr
(=6)
sscFacilityNews
(=7)
sscFacilityUucp (=8)
sscFacilityCron (=9)
sscFacilityLocal0 (=16)
sscFacilityLocal1 (=17)
sscFacilityLocal2 (=18)
sscFacilityLocal3 (=19)
sscFacilityLocal4 (=20)
sscFacilityLocal5 (=21)
sscFacilityLocal6 (=22)
sscFacilityLocal7 (=23).

If this parameter is not specified, sscFacilityUser will be used.

(optional) Priority as Long
Value specifying the priority of the syslog message. It can be one of the following constants:
sscPriorityEmergency (=0)
sscPriorityAlert
(=1)
sscPriorityCritical
(=2)
sscPriorityError
(=3)
sscPriorityWarning
(=4)
sscPriorityNotice
(=5)
sscPriorityInfo
(=6)
sscPriorityDebug
(=7).

If this parameter is not specified, sscPriorityNotice will be used.

(optional) DestinationPort as Long
Value specifying the UDP port to send the syslog message to. If this parameter is not specified, the UDP port 514 will be used.

Return Value

The method returns one of the following result codes:

Result Code Description
sscSyslogSuccess = 0 Syslog message has been successfully sent.
sscSyslogInvalidParameter = 100 On or more of the provided parameters contain an invalid value.
sscSyslogSocketError = 110 An WinSocket related error occurred.
sscSyslogInvalidHostAddress = 120 The specified host address (hostname or IP-address) is invalid.

Remarks

(none)


LMNetwork Object

ProgID SScripting.LMNetwork
File name SScrRun.dll
CLSID 2B6A6DD5-8D36-11D2-8D8F-00A024D26D2E
IID 2B6A6DD4-8D36-11D2-8D8F-00A024D26D2E

Properties

Type Access
ComputerName String Read-only

Methods

Name Parameters
SendNetMessage Destination as String,
MessageText as String

ComputerName Property (LMNetwork Object)

The ComputerName property returns the computer name (NetBIOS name) of the local computer. Read-only.


oLMNetwork.ComputerName
 

Data Type

String

Remarks

(none)


SendNetMessage Method (LMNetwork Object)

Windows NT/2000/XP only

The SendNetMessage method sends a network message to the specified logged-in user, computer, workgroup or domain.


Boolean = oLMNetwork.SendNetMessage( Destination, MessageText )
 

Parameters

Destination as String
String containing the name to send the message to. This name may be the name of a logged-in user, computer, workgroup or domain. If it's the name of a workgroup or domain, an asterisk ('*') must be appended to the name of the workgroup or domain. In this case the message will be sent to all computers within the workgroup or domain.
 
MessageText as String
String containing the message text to send.
 

Return Value

The method returns TRUE if it succeeds, FALSE if it fails.

Remarks

This method is not supported on Windows 98.


NBTNetwork Object

ProgID SScripting.NBTNetwork
File name SScrRun.dll
CLSID 2B6A6DE1-8D36-11D2-8D8F-00A024D26D2E
IID 2B6A6DE0-8D36-11D2-8D8F-00A024D26D2E

Properties

(none)

Methods

Name Parameters
QueryNodeStatus Destination as String,
(optional) Timeout as Long,
(optional) MACAddress as Variant,
(optional) NBNames as Variant,
(optional) NBGroupNameFlags as Variant,
(optional) NBConflictFlags as Variant

QueryNodeStatus Method (NBTNetwork Object)

The QueryNodeStatus method sends an NBSTAT request to the specified host and returns information about the response, if one is received.


Long =
 oNBTNetwork.QueryNodeStatus(
    Destination,
    Timeout,
    MACAddress,
    NBNames,
    NBGroupNameFlags,
    NBConflictFlags
  )
 
 

Parameters

Destination as String
String containing the name or the IP-address of the host to query.
 
(optional) Timeout as Long
Number of milliseconds the method will wait for a response before it returns with sscNBSTATTimeout (=30). If this parameter is not specified, a timeout value of 1500 milliseconds will be used.
 
(optional) MACAddress as Variant
A Variant variable of sub-type String which returns the MAC address of the interface the target IP-address is associated with.
 
(optional) NBNames as Variant
A Variant variable of sub-type Array of Variants of sub-type String which returns the NetBIOS names registered on the specified host. Each NetBios name is exactly 16 characters long. The last character represents the type of the name (<00> = Redirector, <20> = Server, etc.). Please note that the name string may contain embedded nulls
 
(optional) NBGroupNameFlags as Variant
A Variant variable of sub-type Array of Variants of sub-type Bool. The nth array element corresponds to the nth array element of NBNames and indicates if the name is a GROUP name (=TRUE) or a UNIQUE name (=FALSE).
 
(optional) NBConflictFlags as Variant
A Variant variable of sub-type Array of Variants of sub-type Bool. The nth array element corresponds to the nth array element of NBNames and indicates if the name is in conflict (=TRUE) or not (=FALSE).

Return Value

The method returns one of the following result codes:

Result Code Description
sscNBSTATSuccess = 0 A valid NBSTAT Response packet has been received.
sscNBSTATInternalError = 10 An internal error has occurred.
sscNBSTATInvalidResponse = 20 A invalid NBSTAT Response packet has been received.
sscNBSTATTimeout = 30 No response has been received within the timeout period.
sscNBSTATInvalidParameter = 100 On or more of the provided parameters contain an invalid value.
sscNBSTATSocketError = 110 An WinSocket related error occurred.
sscNBSTATInvalidHostAddress = 120 The specified host address (hostname or IP-address) is invalid.

Remarks

This method provides programmatic access to the same information as is returned by the command line "nbtstat -A <ip-address-of-host>".

Please note that if the value of the parameter Destination is a name and not an IP-address, the name is considered to be a hostname, not a computer name. 


SNMPManager Object

ProgID SScripting.SNMPManager
File name SScrRun.dll
CLSID 2B6A6DDB-8D36-11D2-8D8F-00A024D26D2E
IID 2B6A6DDA-8D36-11D2-8D8F-00A024D26D2E

Properties

Type Access
Agent String Read-write
Community String Read-write
Port Long Read-write
Retries Long Read-write
Timeout Long Read-write
Variables Variables collection object Read-only

Methods

Name Parameters
Get (optional) ErrorIndex as Variant
GetNext (optional) ErrorIndex as Variant
Set (optional) ErrorIndex as Variant
GenerateTrap EnterpriseOID as String,
GenericTrap as Long,
(optional) SpecificTrap as Long,
(optional) ErrorIndex as Variant

 

How to prevent run-time problems when using the SNMPManager object:

  1. When the SNMP support DLLs, SNMPAPI.DLL and MGMTAPI.DLL, are loaded during run-time and then unloaded after use, around one page (4KB) of memory does not get freed. This problem is present on Windows NT 4.0 (including SP 6). MS fixed this memory leak in Windows 2000/XP but a new problem has been introduced: unloading the DLLs takes now more than five seconds!
  2. SScrRun delays the loading of the SNMP support DLLs till the first SNMPManager object instance is created. When the last SNMPManager object instance is released, the SNMP support DLLs are unloaded to free resources which are no longer needed.
  3. This implies that if you are repeatedly creating and releasing a first and only instance of the SNMPManager object in a loop or event handler, the resulting memory leak can consume a lot of memory on Windows NT 4.0 or has the effect of a substantial performance hit caused by the unload operation on Windows 2000/XP.
  4. Solution: Create one  instance and use it repeatedly, release it after it is no longer needed. In case that you really have the need for repeatedly creating and releasing an instance of the SNMPManager object, create a first instance of the SNMPManager object before you repeatedly create/release the other object instance. You don't have to make use of  this first object instance, it's just there to prevent the repeated DLL load/unload operations.

Agent Property (SNMPManager Object)

The Agent property specifies the hostname/IP-address of the agent. Read-write.


oSNMPManager.Agent
 

Data Type

String

Remarks

The initial value of this property is "localhost".


Community Property (SNMPManager Object)

The Community property specifies the SNMP community name used when communicating with the agent. Read-write.


oSNMPManager.Community
 

Data Type

String

Remarks

The initial value of this property is "public".


Port Property (SNMPManager Object)

The Port property specifies the UDP port being used for Get and Set operations. Read-write.


oSNMPManager.Port
 

Data Type

Long

Remarks

The initial value of this property is 161.


Retries Property (SNMPManager Object)

The Retries property specifies the communications retry count. The time-out specified by the Timeout property is doubled each time a retry attempt is transmitted. Read-write.


oSNMPManager.Retries
 

Data Type

Long

Remarks

The initial value of this property is 2.


Timeout Property (SNMPManager Object)

The Timeout property specifies the communications time-out in milliseconds. Read-write.


oSNMPManager.Timeout
 

Data Type

Long

Remarks

The initial value of this property is 2000.


Variables Property (SNMPManager Object)

The Variables property returns the Variables collection object. Read-only.


oSNMPManager.Variables
 

Data Type

Object (Variables collection)

Remarks

(none)


Get Method (SNMPManager Object)

Windows NT/2000/2003/XP only

The Get method sends an SNMP Get Request to the agent for all Variable objects within the Variables collection. If a valid response is received, the Type and Value property of all Variable objects is updated.


Long = oSNMPManager.Get( ErrorIndex )
  

Parameters

(optional) ErrorIndex as Variant
A Variant variable of sub-type Long which returns the one-based index of the Variable object which caused the error, but only if the method returns sscSNMPVariableOIDInvalid (=10), otherwise 0 is returned.

Return Value

The method returns one of the following result codes:

Result Code Description
sscSNMPSuccess = 0 The Get operation completed successfully.
sscSNMPVariableOIDInvalid = 10 The OID property of a Variable object specifies an invalid OID. The ErrorIndex parameter returns the one-based index of the Variable object.
sscSNMPDataTooBig = 40 The agent could not place the results of the requested operation into a single SNMP message.
sscSNMPTimeout = 50 The request timed-out.
sscSNMPUnspecifiedError = 60 An error other than one of those listed here occurred during the requested operation.
sscSNMPVariableListEmpty = 70 The Variables collection is empty.
sscSNMPSupportNotAvailable = 80 SNMP support is not available.

Remarks

On Windows 98 this method will always return sscSNMPSupportNotAvailable.


GetNext Method (SNMPManager Object)

Windows NT/ 2000/2003/XP only

The GetNext method sends an SNMP GetNext Request to the agent for all Variable objects within the Variables collection. If a valid response is received, the OID, Type and Value property of all Variable objects is updated.


Long = oSNMPManager.GetNext( ErrorIndex )
  

Parameters

(optional) ErrorIndex as Variant
A Variant variable of sub-type Long which returns the one-based index of the Variable object which caused the error, but only if the method returns sscSNMPVariableOIDInvalid (=10), otherwise 0 is returned.

Return Value

The method returns one of the following result codes:

Result Code Description
sscSNMPSuccess = 0 The GetNext operation completed successfully.
sscSNMPVariableOIDInvalid = 10 The OID property of a Variable object specifies an invalid OID. The ErrorIndex parameter returns the one-based index of the Variable object.
sscSNMPDataTooBig = 40 The agent could not place the results of the requested operation into a single SNMP message.
sscSNMPTimeout = 50 The request timed-out.
sscSNMPUnspecifiedError = 60 An error other than one of those listed here occurred during the requested operation.
sscSNMPVariableListEmpty = 70 The Variables collection is empty.
sscSNMPSupportNotAvailable = 80 SNMP support is not available.

Remarks

On Windows 98 this method will always return sscSNMPSupportNotAvailable.


Set Method (SNMPManager Object)

Windows NT/ 2000/2003/XP only

The Set method sends an SNMP Set Request to the agent for all Variable objects within the Variables collection.


Long = oSNMPManager.Set( ErrorIndex )
  

Parameters

(optional) ErrorIndex as Variant
A Variant variable of sub-type Long which returns the one-based index of the Variable object which caused the error, but only if the method returns sscSNMPVariableOIDInvalid (=10), sscSNMPVariableBadValue (=20) or sscSNMPVariableReadOnly (=30), otherwise 0 is returned.

Return Value

The method returns one of the following result codes:

Result Code Description
sscSNMPSuccess = 0 The Set operation completed successfully.
sscSNMPVariableOIDInvalid = 10 The OID property of a Variable object specifies an invalid OID. The ErrorIndex parameter returns the one-based index of the Variable object.
sscSNMPVariableBadValue = 20 The Value property of a Variable object specifies is invalid. The ErrorIndex parameter returns the one-based index of the Variable object.
sscSNMPVariableReadOnly = 30 An attempt was made to change the value of an SNMP variable which is read-only. The ErrorIndex parameter returns the one-based index of the Variable object.
sscSNMPDataTooBig = 40 The agent could not place the results of the requested operation into a single SNMP message.
sscSNMPTimeout = 50 The request timed-out.
sscSNMPUnspecifiedError = 60 An error other than one of those listed here occurred during the requested operation.
sscSNMPVariableListEmpty = 70 The Variables collection is empty.
sscSNMPSupportNotAvailable = 80 SNMP support is not available.

Remarks

On Windows 98 this method will always return sscSNMPSupportNotAvailable.

 


GenerateTrap Method (SNMPManager Object)

Windows NT SP3+/2000/2003/XP only

The GenerateTrap method generates an SNMP trap. The trap is sent to all configured trap destinations.


Long = oSNMPManager.GenerateTrap( EnterpriseOID, GenericTrap, SpecificTrap, ErrorIndex )
  

Parameters

EnterpriseOID as String
String containing the enterprise OID to be put into the SNMP trap message.
 
GenericTrap as Long
Value specifying the generic trap id to be put into the SNMP trap message. It can be one of the following constants:
sscGenericTrapColdStart (=0)
sscGenericTrapWarmStart (=1)
sscGenericTrapLinkDown (=2)
sscGenericTrapLinkUp (=3)
sscGenericTrapAuthenticationFailure (=4)
sscGenericTrapEGPNeighborLoss (=5)
sscGenericTrapEnterpriseSpecific (=6)
(optional) SpecificTrap as Long
Value specifying the specific trap id to be put into the SNMP trap message. Unless GenericTrap has the value sscGenericTrapEnterpriseSpecific (=6), SpecificTrap must be 0.
 
(optional) ErrorIndex as Variant
A Variant variable of sub-type Long which returns the one-based index of the Variable object which caused the error, but only if the method returns sscSNMPVariableOIDInvalid (=10), sscSNMPVariableBadValue (=20), otherwise 0 is returned.

Return Value

The method returns one of the following result codes:

Result Code Description
sscSNMPSuccess = 0 The GenerateTrap operation completed successfully.
sscSNMPVariableOIDInvalid = 10 The OID property of a Variable object specifies an invalid OID. The ErrorIndex parameter returns the one-based index of the Variable object.
sscSNMPVariableBadValue = 20 The Value property of a Variable object specifies is invalid. The ErrorIndex parameter returns the one-based index of the Variable object.
sscSNMPDataTooBig = 40 The agent could not place the results of the requested operation into a single SNMP trap message.
sscSNMPTimeout = 50 The operation timed-out.
sscSNMPUnspecifiedError = 60 An error other than one of those listed here occurred during the requested operation.
sscSNMPSupportNotAvailable = 80 SNMP support is not available.
sscSNMPTrapGeneratorExtensionNotLoaded = 90 The STGenExt.dll module has not been registered or the SNMP service is not running.
sscSNMPEnterpriseOIDInvalid = 100 An invalid enterprise OID was specified.
sscSNMPGenericTrapIDInvalid = 110 An invalid generic trap id was specified.
sscSNMPSpecificTrapIDInvalid = 120 An invalid specific trap id was specified.

Remarks

On Windows 98 this method will always return sscSNMPSupportNotAvailable.

The following requirements must be met to generate SNMP traps:


Variables Collection Object

The Variables collection contains Variable objects. This collection object is accessed by the Variables property of the SNMPManager object.

Properties

Name Type Access
Count Long Read-only
Item (default) Variable object Read-only

Methods

Name Parameters
Add OID as String,
(optional) Type as Long,
(optional) Value as Variant
Remove Index as Variant
RemoveAll (none)

Remarks

(none)


Count Property (Variables Collection Object)

The Count property returns the number of Variable objects in the collection. Read-only.


oVariablesColl.Count
 

Data Type

Long

Remarks

(none)


Item Property (Variables Collection Object)

The Item property returns a single Variable object from the collection. Read-only.


oVariablesColl.Item( Index )
 
Index as Variant
Index may either be the OID (String) of the Variable object or the one-based index (Long) of the Variable object within the collection.

Data Type

Object (Variable)

Remarks

The Item property works like an accessor property for small collections.

The Item(Index) syntax selects a Variable object within the Scripts collection.

If the specified Variable object is not found in the collection, the Item property returns Nothing.

To iterate through all Variable objects in the Variables collection, use the For...Each statement in VBScript and the Enumerator object in JScript.

Although the Item property itself is read-only, the Variable object it returns can be accessed in the normal manner, and its properties retain their respective read/write or read-only attributes.


Add Method (Variables Collection Object)

The Add method creates a Variable object and adds it to the collection.


oVariable = oVariablesColl.Add( OID, Type, Value )
  

Parameters

OID as String
String which specifies the OID of the SNMP variable.
(optional) Type as Long
Value which specifies the type of the SNMP variable. It may be one of the following constants:
sscASNInteger32 (=2)
sscASNBits
(=3)
sscASNOctetString
(=4)
sscASNNull
(=5)
sscASNObjectIdentifier
(=6)
sscASNIPAddress
(=64)
sscASNCounter32
(=65)
sscASNGauge32
(=66)
sscASNTimeTicks
(=67)
sscASNOpaque
(=68)
sscASNCounter64
(=70)
sscASNUnsigned32
(=71)

If this parameter is not specified, it defaults to sscASNNull (=5).

(optional) Value as Variant
A Variant variable of sub-type Long or String, containing the value of the SNMP variable.

Return Value

The method returns the object it has created.

Remarks

(none)


Remove Method (Variables Collection Object)

The Remove method removes the specified Variable object from the collection.


oVariablesColl.Remove( Index )
  

Parameters

Index as Variant
This parameter may either be the OID (String) of the Variable object to remove or the one-based index (Long) of the Variable object within the collection.

Return Value

(none)

Remarks

(none)


RemoveAll Method (Variables Collection Object)

The RemoveAll method removes all Variable objects from the collection.


oVariablesColl.RemoveAll()
  

Parameters

(none)

Return Value

(none)

Remarks

(none)


Variable Object

A Variable object represents an SNMP variable binding.

Properties

Name Type Access
OID String Read-write
Type Long Read-write
Value (default) Variant Read-write
ValueX Variant Read-only

Methods

(none)

Remarks

(none)


OID Property (Variable Object)

The OID property specifies the OID of the SNMP variable. Read-write.


oVariable.OID
 

Data Type

String

Remarks

The OID property is assumed to contain an absolute OID, no matter if the OID string starts with a dot or not. This means that "1.3.6.1.2.1.1.2.0" and ".1.3.6.1.2.1.1.2.0" are treated identically.


Type Property (Variable Object)

The Type property specifies the ASN type of the SNMP variable. Read-write.


oVariable.Type
 

Data Type

Long

Remarks

The Type property may contain one of the following constants:

sscASNInteger32 (=2)
sscASNBits
(=3)
sscASNOctetString
(=4)
sscASNNull
(=5)
sscASNObjectIdentifier
(=6)
sscASNIPAddress
(=64)
sscASNCounter32
(=65)
sscASNGauge32
(=66)
sscASNTimeTicks
(=67)
sscASNOpaque
(=68)
sscASNCounter64
(=70)
sscASNUnsigned32
(=71)


Value Property (Variable Object)

The Value property specifies the value of the SNMP variable. Read-write.


oVariable.Value
 

Data Type

Variant

Remarks

Dependent on the Type property, the Variant sub-type is either String or Long, as can be seen in the following table:

Type Variant Sub-Type
sscASNInteger32 (=2) Long
sscASNBits (=3) String
sscASNOctetString (=4) String
sscASNObjectIdentifier (=6) String
sscASNIPAddress (=64) String
sscASNCounter32 (=65) Long
sscASNGauge32 (=66) Long
sscASNTimeTicks (=67) Long
sscASNOpaque (=68) String
sscASNCounter64 (=70) String
sscASNUnsigned32 (=71) Long

ValueX Property (Variable Object)

The ValueX property returns the value of the SNMP variable encoded as a hex-digit string. Read-only.


oVariable.ValueX
 

Data Type

Variant

Remarks

This property will only return a hex-digit string if the property value contains a string.


SSHSupport Object

ProgID SScripting.SSHSupport
File name SScrRun.dll
CLSID 2B6A6DD7-8D36-11D2-8D8F-00A024D26D2E
IID 2B6A6DD6-8D36-11D2-8D8F-00A024D26D2E

Properties

(none)

Methods

Name Parameters
PostIPCEvent Destination as String,
EventID as Long,
Parameter
as String

PostIPCEvent Method (SSHSupport Object)

The PostIPCEvent method posts an IPC event to the specified destination script or broadcasts it to all scripts of the specified System Scripting Host application.


Boolean =
  oSSHSupport.PostIPCEvent(
    Destination,
    EventID,
    Parameter
  )
 

Parameters

Destination as String
String which specifies the destination of the IPC event. The destination must be specified in the following format: "//HostAddress:Port/Script", where HostAddress is the hostname or the IP-address of the host on which the destination script is running, Port is the unique application address on the specified host and Script is the name of the destination script. Script may be the empty string (""), in which case the IPC event is broadcasted to all scripts within the destination application.
EventID as Long
Must be a positive number (>=0).
(optional) Parameter as String
Parameter may be an arbitrary string which is delivered to the destination script. The maximum length supported is 32000 characters.

Return Value

The method returns one of the following result codes:

Result Code Description
sscIPCSuccess = 0 IPC event has been successfully posted.
sscIPCInvalidDestination = 10 The specified destination string is invalid.
sscIPCHostUnreachable = 20 The specified destination host could not be reached.
sscIPCApplicationUnreachable = 30 The specified SSH application does not exist, is not running or not configured for receiving IPC events.
sscIPCInvalidScriptName = 40 The specified script does not exist.
sscIPCScriptNotRunning = 50 The specified script is stopped.
sscIPCDataTransferError = 60 An error occurred while transferring the event data to the destination.
sscIPCInvalidParameter = 100 On or more of the provided parameters contain an invalid value.
sscIPCSocketError = 110 An WinSocket related error occurred.
sscIPCInvalidHostAddress = 120 The specified host address (hostname or IP-address) is invalid.

Remarks

An IPC event for the destination script will only be generated if the destination script has registered an IPC notification for the specified EventID. If the destination script exists and is running, but no IPC event is generated because the destination has no matching IPC notification registered, the PostIPCEvent method will nonetheless report success (TRUE).


System Object

ProgID SScripting.System
File name SScrRun.dll
CLSID 2B6A6DD9-8D36-11D2-8D8F-00A024D26D2E
IID 2B6A6DD8-8D36-11D2-8D8F-00A024D26D2E

Properties

Type Access
CurrentDirectory String Read-only
OperatingSystem String Read-only
ProcessorCount Long Read-only
ProcessorDescription String Read-only
ProductType Long Read-only
SystemDirectory String Read-only
TempPath String Read-only
TotalMemory Long Read-only
UserName String Read-only
WindowsDirectory String Read-only

Methods

Name Parameters
GetDriveType (optional) Drive as String
GetFreeDiskSpace (optional) Directory as String
GetLocalTime
GetSystemTime
GetTotalDiskSpace (optional) Directory as String
SetLocalTime LocalTime as Date
SetSystemTime SystemTime as Date
Shutdown Type as Long,
(optional) Force as Boolean
Sleep Duration as Long

CurrentDirectory Property (System Object)

The CurrentDirectory property returns the path of the current directory for the current process. Read-only.


oSystem.CurrentDirectory
 

Data Type

String

Remarks

(none)


OperatingSystem Property (System Object)

The OperatingSystem property returns a string which contains the platform, version and build number of the running operating system. Read-only.


oSystem.OperatingSystem
 

Data Type

String

Remarks

If the platform is Windows NT, an installed Service Pack will also be indicated.


ProcessorCount Property (System Object)

The ProcessorCount property returns the number of processors in the system. Read-only.


oSystem.ProcessorCount
 

Data Type

Long

Remarks

(none)


ProcessorDescription Property (System Object)

Windows NT/2000/XP only

The ProcessorDescription property returns a string which contains the CPU identifier, vendor identifier and CPU speed. Read-only.


oSystem.ProcessorDescription
 

Data Type

String

Remarks

On Windows 98 this method will return the empty string ("") .


ProductType Property (System Object)

Windows NT / Windows 2000 only

The ProductType property returns a number which identifies the product type of the OS. It is one of the following values:
        sscProductTypeUnknown (= -1),
        sscProductTypeWorkstation (= 0),
        sscProductTypeServer (= 1),
        sscProductTypeDomainController (= 2).

Read-only.


oSystem.ProductType
 

Data Type

Long

Remarks

On Windows 98 this property will always return sscProductTypeUnknown (= -1).


SystemDirectory Property (System Object)

The SystemDirectory property returns the path of the system directory. Read-only.


oSystem.SystemDirectory
 

Data Type

String

Remarks

(none)


TempPath Property (System Object)

The TempPath property returns the path of the directory designated for temporary files. Read-only.


oSystem.TempPath
 

Data Type

String

Remarks

(none)


TotalMemory Property (System Object)

The TotalMemory property returns the installed RAM size in MB . Read-only.


oSystem.TotalMemory
 

Data Type

Long

Remarks

(none)


UserName Property (System Object)

The UserName property returns the name of the user account which is associated with the current thread. Read-only.


oSystem.UserName
 

Data Type

String

Remarks

(none)


WindowsDirectory Property (System Object)

The WindowsDirectory property returns the path of the Windows directory. Read-only.


oSystem.WindowsDirectory
 

Data Type

String

Remarks

(none)


GetDriveType Method (System Object)

The GetDriveType method returns the type of the specified drive.


Long = oSystem.GetDriveType( Drive )
 

Parameters

(optional) Drive as String
String which specifies the drive who's type is to be returned. The first character of the string is used as the drive letter, all other characters are ignored. If Drive is the empty string ("") or the parameter is not specified, the type of the current drive is returned.
 

Return Value

The method returns one of the following result codes:

Result Code Description
sscDriveTypeUnknown = 0 The drive type cannot be determined.
sscDriveTypeInvalid = 1 The specified drive does not exist.
sscDriveTypeRemovable = 2 The disk can be removed from the drive.
sscDriveTypeFixed = 3 The disk cannot be removed from the drive.
sscDriveTypeRemote = 4 The drive is a remote (network) drive.
sscDriveTypeCDROM = 5 The drive is a CD-ROM drive.
sscDriveTypeRAMDisk = 6 The drive is a RAM disk.

Remarks

(none)


GetFreeDiskSpace Method (System Object)

The GetFreeDiskSpace method returns the free disk space in KB available on the disk on which the specified directory is located.


Long = oSystem.GetFreeDiskSpace( Directory )
 

Parameters

(optional) Directory as String
String that specifies a directory on the disk of interest. This string can be a UNC name. If Directory is the empty string ("") or the parameter is not specified, the method obtains information about the disk that contains the current directory.
 

Return Value

The method returns the free disk space in KB or -1 if it fails.

Remarks

(none)


GetLocalTime Method (System Object)

The GetLocalTime method returns the current local time and date.


Date = oSystem.GetLocalTime()
 

Parameters

(none)

Return Value

The method returns as a date value the current local time and date.

Remarks

(none)


GetSystemTime Method (System Object)

The GetSystemTime method returns the current system time and date. The system time is expressed in Coordinated Universal Time (UTC).


Date = oSystem.GetSystemTime()
 

Parameters

(none)

Return Value

The method returns as a date value the current system time and date.

Remarks

(none)


GetTotalDiskSpace Method (System Object)

The GetTotalDiskSpace method returns the total disk space in KB of the disk on which the specified directory is located.


Long = oSystem.GetTotalDiskSpace( Directory )
 

Parameters

(optional) Directory as String
String that specifies a directory on the disk of interest. This string can be a UNC name. If Directory is the empty string ("") or the parameter is not specified, the method obtains information about the disk that contains the current directory.
 

Return Value

The method returns the total disk space in KB or -1 if it fails.

Remarks

The following restrictions apply to the initial release of Windows 95:


SetLocalTime Method (System Object)

The SetLocalTime method sets the current local time and date.


Boolean = oSystem.SetLocalTime( LocalTime )
 

Parameters

LocalTime as Date
Date value to be set as the current local time and date.

Return Value

The method returns TRUE if it succeeds, FALSE if it fails.

Remarks

(none)


SetSystemTime Method (System Object)

The SetSystemTime method sets the current system time and date. The system time is expressed in Coordinated Universal Time (UTC).


Boolean = oSystem.SetSystemTime( SystemTime )
 

Parameters

SystemTime as Date
Date value to be set as the current system time and date.

Return Value

The method returns TRUE if it succeeds, FALSE if it fails.

Remarks

(none)


Shutdown Method (System Object)

The Shutdown method either logs off the current user, shuts down the system, or shuts down and restarts the system, or shuts down and powers off the system.


Boolean = oSystem.Shutdown( Type, Force )
 

Parameters

Type as Long
Value specifying the type of shutdown to perform. It can be one of the following constants:
sscShutdownTypeLogoff (=0)
sscShutdownTypeShutdown
(=1)
sscShutdownTypeReboot
(=2)
sscShutdownTypePowerOff
(=3)
(optional) Force as Boolean
If TRUE, processes will be forced to terminate, possibly causing loss of data. Therefore, you should only use this flag in an emergency. If this parameter is not specified, a default value of FALSE will be used.

Return Value

The method returns TRUE if it succeeds, FALSE if it fails.

Remarks

(none)


Sleep Method (System Object)

The Sleep method suspends execution of the calling thread for the specified duration in milliseconds.


oSystem.Sleep( Duration )
 

Parameters

Duration as Long
Number between 0 and 2147483647 which specifies in milliseconds how long thread execution will be suspended.

Return Value

(none)

Remarks

(none)


Providing Feedback

A peer-to-peer newsgroup is available to help you interact with other System Scripting Runtime users. You can use any newsreader software to access this newsgroup. Regardless of the newsreader or news client you are using, you may need to configure it to read the newsgroup. When prompted for the name of the news server, specify news.netal.com. You do not need to enter an account name or password.

There is currently one newsgroup dedicated to the product System Scripting Runtime:

General (netal.ssr.general)

Another way to provide feedback is by sending e-mail to bugreport@netal.com if you detect a bug, or by sending e-mail to featurerequest@netal.com if there is anything else that you would like to see implemented in this product in the future.


Technical Support

If you have a technical question about System Scripting Runtime, post it to the newsgroup mentioned above. We monitor this newsgroup regularly and will try to answer questions as soon as possible.


Copyright Information

1999-2007 Franz Krainer

These materials are provided “as-is,” for informational purposes only.

Neither Franz Krainer nor his suppliers makes any warranty, express or implied with respect to the content of these materials or the accuracy of any information contained herein, including, without limitation, the implied warranties of merchantability or fitness for a particular purpose. Because some states/jurisdictions do not allow exclusions of implied warranties, the above limitation may not apply to you.

Neither Franz Krainer nor his suppliers shall have any liability for any damages whatsoever including consequential, incidental, direct, indirect, special, and lost profits. Because some states/jurisdictions do not allow exclusions of implied warranties, the above limitation may not apply to you.


2007-07-24

www.netal.com
Franz Krainer
franzk@netal.com