据说在setupdll.dll 里。<br>其实你不如这样:<br>procedure SetSystemEnvironmentVariable (const name, value : string);<br>var<br> rv : DWORD;<br>begin<br> with TRegistry.Create do<br> try<br> RootKey := HKEY_LOCAL_MACHINE;<br> OpenKey ('SYSTEM/CurrentControlSet/Control/Session <br>Manager/Environment', False);<br> WriteExpandString (name, value);<br> SendMessageTimeout (HWND_BROADCAST, WM_SETTINGCHANGE, 0, LParam <br>(PChar ('Environment')), SMTO_ABORTIFHUNG,<br> 5000, rv);<br> finally<br> Free<br> end<br>end;<br>