Share via


IScheduler::SetEnvironmentVariable method

Sets a cluster-wide environment variable.

Syntax

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

Parameters

  • name [in]
    The name of the variable.

  • value [in]
    The value of the variable.

Return value

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

Remarks

The sum of all environment variables is limited to 2,048 Unicode characters.

You can use this method to add, delete, or update an environment variable. To delete a variable, set the value parameter to NULL. You cannot delete or update an HPC-defined variable. If you try to delete or update an HPC-defined variable (for example, CCP_CLUSTER_NAME), the operation is ignored.

The method uses a case-insensitive comparison to find the environment variable. If the variable is not found, the method adds the variable. If the variable is found, the method updates its value unless the value is empty or NULL, in which case the method deletes the variable.

To set environment variables for a task, call the ISchedulerTask::SetEnvironmentVariable method.

Requirements

Product

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

Type library

Microsoft.Hpc.Scheduler.tlb

See also

IScheduler

IScheduler.EnvironmentVariables

ISchedulerTask::SetEnvironmentVariable