WSH » WScript » Interactive

Syntax:
WScript.Interactive[ = True|False]

The Interactive property returns a Boolean that indicates whether or not the host executable file (cscript or wscript) was invoked in interactive mode. This property is read/write and can be used to change the mode of the currently executing script at runtime. When this property is False, interactive commands such as Echo, MsgBox and InputBox have no effect. The WshShell.Popup method, and the use of StdErr, StdIn and StdOut are, however, unaffected by the setting of this property.

Examples

Code:
WScript.Echo("Hello")
WScript.Interactive = false
WScript.Echo("In non-interactive mode")
WScript.Interactive = true
WScript.Echo("Goodbye")
Output:
Hello
Goodbye
Explanation:

This JScript code illustrates the use of this property.

Language(s): JavaScript