{"id":65,"date":"2007-05-11T21:22:20","date_gmt":"2007-05-11T19:22:20","guid":{"rendered":" http:\/\/www.nsonic.de\/blog\/2007\/05\/newsflashenvironment-setsystemenvironmentvariable\/"},"modified":"2007-05-11T21:22:21","modified_gmt":"2007-05-11T19:22:21","slug":"newsflashenvironment-setsystemenvironmentvariable","status":"publish","type":"post","link":"https:\/\/www.nsonic.de\/blog\/2007\/05\/newsflashenvironment-setsystemenvironmentvariable\/","title":{"rendered":"Newsflash\n\t\nEnvironment: SetSystemEnvironmentVariable"},"content":{"rendered":"<p>This is how you do it in NT&#8230;.<\/p>\n<p>[code lang=&#8221;delphi&#8221;]procedure SetSystemEnvironmentVariable (const name, value : string);<br \/>\nvar<br \/>\n rv : DWORD;<br \/>\nbegin<br \/>\n  with TRegistry.Create do<br \/>\n  try<br \/>\n    RootKey := HKEY_LOCAL_MACHINE;<br \/>\n    OpenKey (&#8216;SYSTEM\\CurrentControlSet\\Control\\Session<br \/>\n    Manager\\Environment&#8217;, False);<br \/>\n    WriteExpandString (name, value);<br \/>\n    SendMessageTimeout (HWND_BROADCAST, WM_SETTINGCHANGE, 0, LParam (PChar (&#8216;Environment&#8217;)), SMTO_ABORTIFHUNG, 5000, rv);<br \/>\n  finally<br \/>\n    Free<br \/>\n  end<br \/>\nend;[\/code]<\/p>\n<p>[tags]Delphi, API[\/tags]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is how you do it in NT&#8230;. [code lang=&#8221;delphi&#8221;]procedure SetSystemEnvironmentVariable (const name, value : string); var rv : DWORD; begin with TRegistry.Create&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[11],"tags":[84,75],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p71Tml-13","_links":{"self":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/posts\/65"}],"collection":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/comments?post=65"}],"version-history":[{"count":0,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/posts\/65\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/media?parent=65"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/categories?post=65"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/tags?post=65"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}