Share via


IVsLaunchPad.ExecCommand Method

Executes a command with output piped to an output pane in the IDE.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)

Syntax

'Declaration
Function ExecCommand ( _
    pszApplicationName As String, _
    pszCommandLine As String, _
    pszWorkingDir As String, _
    lpf As UInteger, _
    pOutputWindowPane As IVsOutputWindowPane, _
    nTaskItemCategory As UInteger, _
    nTaskItemBitmap As UInteger, _
    pszTaskListSubcategory As String, _
    pVsLaunchPadEvents As IVsLaunchPadEvents, _
    <OutAttribute> ByRef pdwProcessExitCode As UInteger, _
    <OutAttribute> pbstrOutput As String() _
) As Integer
int ExecCommand(
    string pszApplicationName,
    string pszCommandLine,
    string pszWorkingDir,
    uint lpf,
    IVsOutputWindowPane pOutputWindowPane,
    uint nTaskItemCategory,
    uint nTaskItemBitmap,
    string pszTaskListSubcategory,
    IVsLaunchPadEvents pVsLaunchPadEvents,
    out uint pdwProcessExitCode,
    string[] pbstrOutput
)
int ExecCommand(
    [InAttribute] String^ pszApplicationName, 
    [InAttribute] String^ pszCommandLine, 
    [InAttribute] String^ pszWorkingDir, 
    [InAttribute] unsigned int lpf, 
    [InAttribute] IVsOutputWindowPane^ pOutputWindowPane, 
    [InAttribute] unsigned int nTaskItemCategory, 
    [InAttribute] unsigned int nTaskItemBitmap, 
    [InAttribute] String^ pszTaskListSubcategory, 
    [InAttribute] IVsLaunchPadEvents^ pVsLaunchPadEvents, 
    [OutAttribute] unsigned int% pdwProcessExitCode, 
    [OutAttribute] array<String^>^ pbstrOutput
)
abstract ExecCommand : 
        pszApplicationName:string * 
        pszCommandLine:string * 
        pszWorkingDir:string * 
        lpf:uint32 * 
        pOutputWindowPane:IVsOutputWindowPane * 
        nTaskItemCategory:uint32 * 
        nTaskItemBitmap:uint32 * 
        pszTaskListSubcategory:string * 
        pVsLaunchPadEvents:IVsLaunchPadEvents * 
        pdwProcessExitCode:uint32 byref * 
        pbstrOutput:string[] byref -> int
function ExecCommand(
    pszApplicationName : String, 
    pszCommandLine : String, 
    pszWorkingDir : String, 
    lpf : uint, 
    pOutputWindowPane : IVsOutputWindowPane, 
    nTaskItemCategory : uint, 
    nTaskItemBitmap : uint, 
    pszTaskListSubcategory : String, 
    pVsLaunchPadEvents : IVsLaunchPadEvents, 
    pdwProcessExitCode : uint, 
    pbstrOutput : String[]
) : int

Parameters

  • pszApplicationName
    Type: System.String

    [in] Application name that is passed to CreateProcess by the environment. For more information, see CreateProcess.

  • pszCommandLine
    Type: System.String

    [in] Command line string that is passed to CreateProcess by the environment.

  • pszWorkingDir
    Type: System.String

    [in] Working directory that is passed to CreateProcess by the environment. Can be nulla null reference (Nothing in Visual Basic).

  • pdwProcessExitCode
    Type: System.UInt32%

    [out] Value returned by process.

  • pbstrOutput
    Type: array<System.String[]

    [out] true if all output was generated. Can be nulla null reference (Nothing in Visual Basic).

Return Value

Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsLaunchPad::ExecCommand(
   [in] LPCOLESTR pszApplicationName,
   [in] LPCOLESTR pszCommandLine,
   [in] LPCOLESTR pszWorkingDir,
   [in] LAUNCHPAD_FLAGS lpf,
   [in] IVsOutputWindowPane *pOutputWindowPane,
   [in] ULONG nTaskItemCategory,
   [in] ULONG nTaskItemBitmap,
   [in] LPCOLESTR pszTaskListSubcategory,
   [in] IVsLaunchPadEvents *pVsLaunchPadEvents,
   [out] DWORD *pdwProcessExitCode,
   [out] BSTR *pbstrOutput
);

If ExecBatchScript is called with lpf set to LPF_PipeStdoutToOutputWindow | LPF_PipeStdoutToTaskList, ExecBatchScript internally calls ParseOutputStringForTaskItem. This means that any output generated by pszApplicationName must meet the format requirements of ParseOutputStringForTaskItem.

.NET Framework Security

See Also

Reference

IVsLaunchPad Interface

Microsoft.VisualStudio.Shell.Interop Namespace