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,473 other followers

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 Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

 
%d bloggers like this: