I need to set an environment variable in NT4.0. At this time, I open the system

dialog from the control panel and then use SendKeys to set the variable. I hate using SendKeys, so I hope there is another solution.


I tried updating the registry with the new environment variable, and it did show

up in the Environment tab of the System Properties dialog, but the change doesn't take effect until I manually click the OK button on that tab.


Does anyone know what happens when you click that OK button? Does anyone know how to accomplish this task without SendKeys?


Thanks. Please respond via email.