The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,860 other subscribers

Windows: setx sets environment variables in a persistent way (from values on cmd-line, registry or text files)

Posted by jpluimers on 2014/04/02

Wow, I totally missed the introduction of SETX.

From TechNet:

SETX:

Creates or modifies environment variables in the user or system environment, without requiring programming or scripting. The Setx command also retrieves the values of registry keys and writes them to text files.

Even better, is that it allows you take values from these sources so it is easy to get those into environment variables:

  • Command-line parameter
  • Registry key
  • Text file (with some filtering/search options)

From a bit of searching around, I think it got introduced in a Windows Resource Kit, and got included by default starting Windows Vista.

Excellent addition to my toolset (:

–jeroen

via Setx.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.