This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can trysigning in orchanging directories.
Access to this page requires authorization. You can trychanging directories.
Environment variables specify search paths for files, directories for temporary files, application-specific options, and other similar information. The system maintains an environment block for each user and one for the computer. The system environment block represents environment variables for all users of the particular computer. A user's environment block represents the environment variables the system maintains for that particular user, including the set of system environment variables.
By default, each process receives a copy of the environment block for its parent process. Typically, this is the environment block for the user who is logged on. A process can specify different environment blocks for its child processes using theCreateProcess orCreateProcessAsUser function.
To add or modify environment variables, the user selectsSystem from theControl Panel, then selects theEnvironment tab. The user can also add or modify environment variables at a command prompt using theset command. Environment variables created with theset command apply only to the command window in which they are set, and to its child processes. For more information, typeset /? at a command prompt.
To retrieve a copy of the environment block for a given user, use theCreateEnvironmentBlock function. To free an environment block created byCreateEnvironmentBlock, use theDestroyEnvironmentBlock function. These functions reference a pointer to an environment block. The environment block is an array of null-terminated Unicode strings. The list ends with two nulls (\0\0).
To expand a string that contains environment variables by using the environment block for a specified user, use theExpandEnvironmentStringsForUser function.
Was this page helpful?
Was this page helpful?