KBI 310802 WScript Object Is Not Supported In VBScript/WMI Rule Or Action

Version

Argent Advanced Technology all versions

Date

Wednesday, 15 Jan 2014

Summary

WScript object cannot be used in VBScript/WMI Rule or WMI Action Script of any Argent AT products

Technical Background

WScript object is implemented within CScript.exe or WScript.exe

It is NOT an external ActiveX object that can be created through ‘CreateObject‘ method

As a result, WScript object cannot be used in VBScript Rule or WMI Action Script

Customer typically misuses WScript for two purposes:

  • Use ‘WScript.echo‘ to write something to the console

    Instead, customer should use Argent AT built-in ‘WriteStatus‘ method to write to service log, or ‘DoMessage‘ method to generate a network message

  • Use ‘WScript.Sleep‘ to pause script for some milliseconds

    Instead, customer should use Argent AT built-in ‘IsCancelled‘ method in VBScript/WMI Rule, and ‘Wait‘ method in WMI Action Script

(VBScript/WMI Rule)

IsCancelled 3000	'Pause for 3 seconds



(WMI Action Script)

Wait 3000		'Pause for 3 seconds 

Note:

  • Wait‘ method in WMI Action Script is only available in Argent AT 3.1A-1401-B and later
  • IsCancelled‘ method in VBScript/WMI Rule is originally designed to pause until timer expires or task is cancelled

    It can be simply used for pausing the script

Resolution

N/A