VBScriptEngine.ExecuteCommand Method |
Executes script code as a command.
Namespace: Microsoft.ClearScript.Windows.CoreAssembly: ClearScript.Windows.Core (in ClearScript.Windows.Core.dll) Version: 7.5.0
Syntaxpublic override string ExecuteCommand(
string command
)
Public Overrides Function ExecuteCommand (
command As String
) As String
public:
virtual String^ ExecuteCommand(
String^ command
) override
abstract ExecuteCommand :
command : string -> string
override ExecuteCommand :
command : string -> string
Parameters
- command String
- The script command to execute.
Return Value
StringThe command output.
Implements
IScriptEngine.ExecuteCommand(String)
Remarks
This method is similar to Evaluate(String) but optimized for
command consoles. The specified command must be limited to a single expression or
statement. Script engines can override this method to customize command execution as
well as the process of converting the result to a string for console output.
The VBScriptEngine version of this method supports both expressions and
statements. If the specified command begins with "eval " (not case-sensitive), the
engine executes the remainder as an expression and attempts to use
CStr
to convert the result value. Otherwise, it executes the command as a statement and does
not return a value.
See Also