Skip Ribbon Commands
Skip to main content
SharePoint

Command Service - Parameters

Description of Parameters in the Command Service

Input Parameters

arguments: any arguments or parameters required by the executable specified in the fileName parameter.  For example, "md C:\FileRepository" specifies the arguments for cmd.exe

fileName: the name of the executable being called in the command.  For example, cmd.exe runs a standard command prompt.

jobId: the unique identifier of the Process executing a command.

redirectOutput: a Boolean indicator, specifying the Standard Output and Standard Error streams are to be captured by the Command Service, i.e. that the StandardOutput and StandardError Output Parameters contain the value of these streams from the command.  For example, fileName: cmd.exe with an argument: dir "C:\Program Files" emulates opening a Command Prompt and listing the files in a particular directory.  By setting the redirectOutput parameter to 1 (TRUE), you tell the Command Service to capture the listing of files in the StandardOutput parameter.

redirectOutputSpecified: a Boolean indicator, specifying that the redirectOutput parameter has a value

waitTimeout: the duration, in seconds, for the call to the Command Service to wait until completing.  If the command does not respond by the end of the waitTimeout, the Method will complete and return the values of the Output parameters at that time, but the command itself will continue to execute until it completes.

waitTimeoutSpecified: a Boolean indicator, specifying that the waitTimeout parameter has a value

 

*Best Practice: Bluespring recommends specifying a value for waitTimeout for all calls to the Execute Method, including setting waitTimeoutSpecifed to 1 (True).

 

workingDirectory: the path to the fileName, without the specific file.  For example, let's say you wish to register a .NET .dll file via the Assembly Registration Tool (regasm.exe).  You would set the fileName to: regasm.exe and the workingDirectory to: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727

Output Parameters

EndTime: the time when the command completed

EndTimeSpecified: a Boolean indicator, specifying the EndTime has a value

ExitCode: the Exit Code for the command

ExitCodeSpecified: a Boolean indicator, specifying the ExitCode has a value

FileName: the file name of the command executed

Id: the unique identifier of the Process that ran the command

IsComplete: a Boolean indicator, specifying if the command has completed (True) or not (False)

IsCompleteSpecified: a Boolean indicator, specifying IsComplete has a value

ProcessId: the operating system's PID, as seen in Task Manager

ProcessIdSpecified: a Boolean indicator, specifying ProcessId has a value

StandardError: the text value of the StandardError stream

StandardOutput: the text value of the StandardOutput stream

StartTime: the time the command initiated

StartTimeSpecified: a Boolean indicator, specifying the StartTime has a value

Last modified at 7/31/2020 10:44 AM