Share via


ISchedulerTask::SetEnvironmentVariable method

Sets a task-specific environment variable.

Syntax

HRESULT SetEnvironmentVariable(
  [in] BSTR name,
  [in] BSTR value
);

Parameters

  • name [in]
    The name of the variable.

  • value [in]
    The string value of the variable. If NULL or an empty string, the variable is deleted.

Return value

If the method succeeds, the return value is S_OK. Otherwise, the return value is an error code. To get a description of the error, access the ErrorMessage task property.

Remarks

The length of all environment variables specified for the task is limited to 2,048 Unicode characters.

The environment variables that are made available to the task include variables set using this method, those set using the IScheduler::SetEnvironmentVariable method, and the HPC-defined environment variables.

To retrieve variables from inside your task, call the Win32 function GetEnvironmentVariable.

To set cluster-wide environment variables, call the IScheduler::SetEnvironmentVariable method.

Requirements

Product

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

Type library

Microsoft.Hpc.Scheduler.tlb

See also

IScheduler::SetEnvironmentVariable

ISchedulerTask

ISchedulerTask.EnvironmentVariables