Which registry key? You would want to use the ReadValue() function to read the value, you can then use one of the Set commands to set the environment variable.