Debugging Tools for Windows

ExecuteCommandFile

The ExecuteCommandFile and ExecuteCommandFileWide methods open the specified file and execute the debugger commands that are contained within.

HRESULT
  IDebugControl::ExecuteCommandFile(
    IN ULONG  OutputControl,
    IN PCSTR  CommandFile,
    IN ULONG  Flags
    );

HRESULT
  IDebugControl4::ExecuteCommandFileWide(
    IN ULONG  OutputControl,
    IN PCWSTR  CommandFile,
    IN ULONG  Flags
    );

#ifdef UNICODE
#define ExecuteCommandFileT ExecuteCommandFileWide
#else
#define ExecuteCommandFileT ExecuteCommandFile
#endif

Parameters

OutputControl
Specifies where to send the output of the command. For possible values, see DEBUG_OUTCTL_XXX. For more information about output, see Input and Output.
CommandFile
Specifies the name of the file that contains the commands to execute. This file is opened for reading and its contents are interpreted as if they had been typed into the debugger console.
Flags
Specifies execution options for the command. The default options are to log the command but not to send it to the output. For details about the values that Flags can take, see Execute.

Return Value

S_OK
The method was successful.

This method might also return error values, including error values caused by a failure to open the specified file. For more information, see Return Values.

Interface Version

ExecuteCommandFile is available in all versions of IDebugControl. ExecuteCommandFileWide is available in IDebugControl4 and later versions.

Comments

These methods read the specified file and execute the commands one line at a time using Execute. If an exception occurred while executing a line, the execution will continue with the next line.

Requirements

Headers: Defined in Dbgeng.h. Include Dbgeng.h.

See Also

Execute

Build machine: CAPEBUILD