.set env <EnvironGroup> "<VariableName>=<DesiredValue>"
The .set command changes the master record for an environment. When the system runs a project, it makes a copy of the project environment from the master record, stores the copy in the job records, and uses that copy as the project default.
The fact that the system keeps a separate job copy of the variables, and that the .set command does not change the job copy, has the following effects:
When a .set command modifies the master record for an environment, later steps which use the default environment do not see the changes, because the system does not refer back to the master record; it uses the job copy for the default environment.
If you use a .set command to modify an environment, and a later step specifies the same environment the later step will see the changes you made, because the system goes back to the master record for the environment when the step has a specific environment selected. This works even if the step's environment is the same environment as the project default.
Changes made by a .set command persist after a job is over. Future runs use the values created by previously-run .set commands.
For more information on using this command, see Changing Environment Variable Values During a Job. Also see the similar command .bset.