Skip to main content

NightWatchman Enterprise 7.3

NightWatchman scripting properties

NightWatchman scripting properties

Property

Notes

LogFileName

CString NWMScript.LogFileName – property to set the destination of the log file. Any backslash characters in the path will need to be escaped.

Inputs
  • none

Returns
  • none

Example

To set the location of the NightWatchman log file for the current script to C:\TEMP\NWM.LOG

NwmScript.LogFileName = "C:\\TEMP\\nwm.log";
PowerdownAction

integer NWMScript.PowerdownAction – property to return the action used during power down. The NightWatchman RunAlways.vbs script may be called when the computer is set to go into any of these states. This property may be used to distinguish between states where the computer is powered off and those where the computer is put into a low-power state and modify its behavior accordingly.

Inputs
  • null

Returns

This property may return one of the following values:

  • 0 – not set

  • 1 – power off

  • 2 – reboot

  • 3 – logoff

  • 4 – hibernate

  • 5 – standby

Example

To run a conditional test to see if the power down action is standby:

Set NwmScript = 
WScript.CreateObject("NWMSCRIPT.NWMScriptHelperCtrl.2") 
If NwmScript.PowerdownAction == 5 
  Then 'if powerdown action is standby 'Do SOMETHING  
  Else 'DO SOMETHING ELSE
End If

TimeoutSecs

long NWMScript.TimeoutSecs – the wait for window timeout. This property is also used as the default timeout for WaitWindowGone.

Inputs
  • none

Returns
  • none

Example

To set the timeout value to 10:

NwmScript.TimeoutSecs = 10;

debug

Short NWMScript.debug – the debugging level. The debugging level may be between 0 and 3. With 0 turning debug information off and 3 being the maximum verbose level.

Inputs
  • none

Returns
  • none

Example

To set no debug:

NwmScript.debug = 0;

To set parameter and results debugging information:

NwmScript.debug = 1;

To set the maximum amount of debugging:

NwmScript.debug = 3;