Search This Blog

Thursday, August 22, 2013

Setting environment system variables in a task sequence

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

image

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:

image

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.

image

2 comments:

  1. A reboot is required if you want to use the new/updated env-var in a later step of the TS.

    ReplyDelete
  2. Would just like to say thank you here in 2019. This was very helpful!

    ReplyDelete