Property:  WScript.Timeout

WScript.Timeout

The Timeout property is used to set or get the timeout period (in seconds) for the currently executing script. The script will automatically be terminated after the number of seconds specified by this property, which is of type Long. This property is not currently documented by Microsoft.

The following VBScript code illustrates the use of this property when run under cscript.

Code:
WScript.Timeout = 2
WScript.Echo "Starting Script"
WScript.Sleep 5000
WScript.Echo "Ending Script"


Output:
Starting Script
Script execution time was exceeded on script "C:\test.vbs".
Script execution was terminated.

Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information