Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: Set Personal Environment Variable from PowerShell

$
0
0

Summary: Access the $ENV object in Windows PowerShell to alter personal environment settings.

Hey, Scripting Guy! Question How can I use Windows PowerShell to change a system environment variable such as the user %TEMP%?

Hey, Scripting Guy! Answer You can read any personal environment settings by using $ENV:VariableName, then assigning a value.
           For example, to change your personal %TEMP% to a new location, use:

$ENV:Temp=C:\Foo

Note This presumes C:\Foo exists and will alter the variable for the present PowerShell session.


Viewing all articles
Browse latest Browse all 3333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>