One way to set a environment system variable during a MDT or SCCM Task Sequence is to use the SETX command. http://technet.microsoft.com/en-us/library/cc755104(v=ws.10).aspx
This command SETX LLVAR TEST /M will set the variable LLVAR to the value TEST
If we take a closer look at the System variables after this step, we will see that the variable has been defined and the value set to TEST:
We can also use existing system variables, this command will add a new directory path to the existing System variable PATH using the existing value of both %PATH% and %PROGRAMFILES(X86)% in the command.