IScheduler::CreateCommand method

Creates a command to execute.

Syntax

HRESULT CreateCommand(
  [in]  BSTR              commandLine,
  [in]  ICommandInfo      *info,
  [in]  IStringCollection *nodeSelection,
  [out] IRemoteCommand    **command
);

Parameters

  • commandLine [in]
    The command to execute. The command is limited to 480 Unicode characters.

  • info [in]
    An ICommandInfo interface that provides additional property values used by the command. If the command does not use the additional property values, set to NULL.

  • nodeSelection [in]
    An IStringCollection interface that identifies the nodes on which the command will run. To run the command on all nodes, set to NULL.

  • command [out]
    An IRemoteCommand interface that defines the command to run.

Return value

If the method succeeds, the return value is S_OK. Otherwise, the return value is an error code.

Remarks

To capture the output from the command, you must subscribe to the events that the command object raises. For details, see the IRemoteCommandEvents interface.

To run a command, the user must run the calling application as an administrator.

When you create a command, you are creating a special job that runs immediately on the specified nodes. The job contains two tasks: the command to run and a proxy task used by the scheduler to process the output from the command (use the ISchedulerTask.Name property to distinguish the two tasks). You cannot rerun a command. Only users with elevated administrator privileges can run commands.

Examples

For an example, see Executing Commands.

Requirements

Product

HPC Pack 2008 R2 Client Utilities, HPC Pack 2008 Client Utilities

Header

Oledb.h

Type library

Microsoft.Hpc.Scheduler.tlb

See also

IScheduler

IScheduler::CreateJob