User environment variables in Windows
Persistent user environment variables in Windows.
My normal mechanism for setting persistent environment variables on Windows is via Control Panel, open the System icon and choose the advanced system settings option. From there you can use the option for setting user and system level environment variables. You can also use the shortcut of running sysdm.cpl
, select the Advanced tab and use the Environment variables button.
However, I normally find myself working on a locked down Windows system that I don't have admin access on, some kind of VDI or laptop. In these environments you are blocked by User Account Control of using the above method. There are also generally restrictions on PowerShell and other tools that could be used.
A quick and easy method that generally works is to run:
rundll32 sysdm.cpl,EditEnvironmentVariables
You can then easily define user variables and values in the resulting Environment Variables dialog.