You simply use it directly in the code.

Code:
"Clientname = " + %CLIENTNAME% + @CRLF



You may also use ExpandEnvironmentVars(), where the environment variable is present in a string, such as an EXPAND_SZ read from the registry.