POST POST

MAY
8
2021

Setting a persistent environment variable

ORIGINALLY POSTED TO: https://blog.simontimms.com/2021/05/08/set-env-variable

If you want to set a variable but you want it to live forever then you can use

1
[System.Environment]::SetEnvironmentVariable("JAVA_HOME", "c:\program files\openjdk\jdk-13.0.2", "Machine")

That last argument can take on the values {Process, User, Machine}


Simon Timms

Email Email
Web Web
Twitter Twitter
GitHub GitHub
RSS

Looking for someone else?

You can find the rest of the Western Devs Crew here.

© 2015 Western Devs. All Rights Reserved. Design by Karen Chudobiak, Graphic Designer