Share via


ISchedulerJob::SetEnvironmentVariable method

Sets the specified environment variable to the specified value in the context of the job.

Syntax

HRESULT SetEnvironmentVariable(
  [in] BSTR Name,
  [in] BSTR Value
);

Parameters

  • Name [in]
    A string that specifies the name of the environment variable that you want to set in the context of the job.

  • Value [in]
    A string that specifies the value to which you want to set the environment variable. To unset an environment variable in the context of a job, specify an empty string.

Return value

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

Remarks

If you set or unset an environment variable for a job, that environment variable is also set or unset for each task in the job unless you override that environment variable setting for the task by calling the ISchedulerTask::SetEnvironmentVariable method.

Requirements

Product

HPC Pack 2008 R2 Client Utilities

Type library

Microsoft.Hpc.Scheduler.tlb

See also

ISchedulerJob

ISchedulerTask::SetEnvironmentVariable

ISchedulerJob::EnvironmentVariables