Gemstone Common Library
Show/Hide TOC

# CommandExecute(String, String, String, String, Boolean, Int32, Int32) Method

Executes a command line operation and returns true if there was no standard error reported.

## Definition

Namespace: Gemstone.Console
Assembly: Gemstone.Common (in Gemstone.Common.dll) Version: 1.0.160 -- Release Build+19b74ac03cedad8575bb1ceb00051318b7421d0d
C#
View Source Request Example

    public static bool Execute(
    	string fileName,
    	string? arguments,
    	out string standardOutput,
    	out string standardError,
    	out bool processCompleted,
    	out int exitCode,
    	int timeout
    )

VB
View Source Request Example

    Public Shared Function Execute (
    	fileName As String,
    	arguments As String,
    	<OutAttribute> ByRef standardOutput As String,
    	<OutAttribute> ByRef standardError As String,
    	<OutAttribute> ByRef processCompleted As Boolean,
    	<OutAttribute> ByRef exitCode As Integer,
    	timeout As Integer
    ) As Boolean

C++
View Source Request Example

    public:
    static bool Execute(
    	String^ fileName,
    	String^ arguments,
    	[OutAttribute] String^% standardOutput,
    	[OutAttribute] String^% standardError,
    	[OutAttribute] bool% processCompleted,
    	[OutAttribute] int% exitCode,
    	int timeout
    )

JavaScript
View Source Request Example

    Gemstone.Console.Command.Execute = function(fileName, arguments, standardOutput, standardError, processCompleted, exitCode, timeout);

#### Parameters

fileName String
  Command line file name to execute.
arguments String
  Command line arguments to use, if any.
standardOutput String
  Any standard output reported by the command line operation.
standardError String
  Any standard error reported by the command line operation.
processCompleted Boolean
  Flag that determines if process completed or timed-out. This is only relevant if timeout is not -1.
exitCode Int32
  Exit code of the process, assuming process successfully completed.
timeout Int32
  Timeout, in milliseconds, to wait for command line operation to complete. Set to Infinite, i.e., -1, for infinite wait.

#### Return Value

Boolean
true if there was no standard error reported; otherwise, false.

## See Also

#### Reference

Command Class
Execute Overload
Gemstone.Console Namespace