To make the environment variable accessible globally you need to set it in the registry. As you've realised by just using:

set NEWVAR=SOMETHING

you are just setting it in the current process space.

According to this page you can use the setx command:

setx NEWVAR SOMETHING

setx is built into Windows 7, but for older versions may only be available if you install the Windows Resource Kit

Answer from ChrisF on Stack Exchange
🌐
Microsoft Learn
learn.microsoft.com › en-us › windows-server › administration › windows-commands › set_1
set (environment variable) - Windows commands
If you use the set command without any parameters, the current environment settings are displayed. These settings usually include the COMSPEC and PATH environment variables, which are used to help find programs on disk. Two other environment variables used by Windows are PROMPT and DIRCMD.
Discussions

Environment Variable Setting via Command Line
Is there a command line I can use to set PC and Server environment variables? I have several I have to type in often. It would be nice to write a script to enter them for me. More on community.spiceworks.com
🌐 community.spiceworks.com
3
6
July 28, 2022
go - How can I set the environment variables in Windows? - Stack Overflow
It reads the environment variables in Windows. On a Windows laptop, I have the privilege to set user variables for my user login only. More on stackoverflow.com
🌐 stackoverflow.com
Add environment property to the profiles in settings.json
Area-SettingsIssues related to ... new Windows Terminal.Resolution-DuplicateThere's another issue on the tracker that's pretty much the same thing.There's another issue on the tracker that's pretty much the same thing. ... Following @DHowett suggestion in #6585. For tools like MinGW you need certain environment variables to be set that define ... More on github.com
🌐 github.com
10
June 20, 2020
Pycharm environment variables
That's an entirely different environment. Do you want to set system-wide environmental variables? How you do that will depend on your OS. In Windows, press start and type "environmental variables" and you can set them in there. More on reddit.com
🌐 r/Python
10
2
July 15, 2017
🌐
Sigasi
sigasi.com › knowledge › how_tos › setting-environment-variables
Setting Environment Variables - Sigasi
September 23, 2024 - Set an environment variable temporarily by typing: ... Note: This will only last for the current terminal session. The variable will disappear when the terminal is closed.
🌐
NTU Singapore
www3.ntu.edu.sg › home › ehchua › programming › howto › Environment_Variables.html
Environment Variables in Windows/macOS/Linux
An environment variable set via the "set" command under CMD is a local, available to the current CMD session only. Try setting a variable, re-start CMD and look for the variable. To reference a variable in Windows, use %varname% (with prefix and suffix of '%').
🌐
Autodesk
autodesk.com › support › technical › article › caas › sfdcarticles › sfdcarticles › How-to-set-an-environment-variable.html
How to set an environment variable
How to set an environment variable in different Operative Systems How to Set Environment Variables in macOS , Windows , and Linux. For macOS terminal based programs macOS Mojave (10.14) or earlier (bash is the default shell). Permanent environment variable in bash for the current user: Edit or create`~/.bash_profile` in a text editor (`~/.bashrc` for only interactive terminal sessions)
Find elsewhere
🌐
Medium
kevinlinxc.medium.com › viewing-and-setting-environment-variables-in-every-shell-4df43127bd8
Viewing and Setting Environment Variables in Every Shell | by Kevin Lin | Medium
September 11, 2023 - I write software on Windows, Mac and occasionally Linux. I always find myself forgetting what magic words to use for different shells, and Googling usually results in a surprising amount of friction for finding exactly what I want, so I’ve compiled a quick reference below. ... # list all environment variables ls env: # fetch a specific environment variable $env:VariableName # pretty print the PATH variable (one path per line) $env:PATH -split ';' # set an environment variable for the current session $env:VariableName = "Value" # delete an environment variable for the current session Remove-Item Env:\VariableName
🌐
Eleven Forum
elevenforum.com › windows support forums › tutorials
Create New Environment Variables in Windows 11 | Windows 11 Forum
November 20, 2024 - Substitute [variable name] in the command above with the actual variable name (ex: "Downloads") you want used as the environment variable (ex: "%Downloads%" or "$Env:Downloads"). Substitute [variable value] in the command above with the actual variable value (ex: "%UserProfile%\Downloads") you want referenced by the environment variable. For example: [Environment]::SetEnvironmentVariable("Downloads","%UserProfile%\Downloads","Machine") 3 You can now close Windows Terminal (Admin) if you like.
🌐
GitHub
github.com › microsoft › terminal › issues › 6604
Add environment property to the profiles in settings.json · Issue #6604 · microsoft/terminal
June 20, 2020 - I suggest to add a property to the profile description in settings.json to set environment variables. For example · { "environment" : { "PATH": "c:/doomsday/emergency_commands/bin;${env:PATH}", "EMRGENCY_LEVEL_HIGH": "1" } } ... Area-SettingsIssues related to settings and customizability, for console or terminalIssues related to settings and customizability, for console or terminalHelp WantedWe encourage anyone to jump in on these.We encourage anyone to jump in on these.Issue-FeatureComplex enough to require an in depth planning process and actual budgeted, scheduled work.Complex enough to re
Author   microsoft
🌐
Foundry
learn.foundry.com › nuke › 13.2 › content › comp_environment › configuring_nuke › environment_variables.html
Setting Environment Variables - Foundry Learn
In both cases, VARIABLE should be replaced by the environment variable you're interested in. For example, NUKE_TEMP_DIR on Windows returns: ... If the variable is set, its value is displayed in the command window. If the variable is set, its value is displayed in the Terminal or shell window.
🌐
PhoenixNAP
phoenixnap.com › home › kb › sysadmin › how to set environment variable in windows
How to Set Environment Variables in Windows
December 9, 2025 - The method for checking current environment variables depends on whether you are using the Command Prompt or Windows PowerShell: In the Command Prompt, use the following command to list all environment variables: ... Both the Command Prompt and PowerShell use the echo command to list specific environment variables. ... Here, [variable_name] is the name of the environment variable you want to check. Follow the steps to set environment variables using the Windows GUI:
Top answer
1 of 9
179

Note: After seeing lots of comments about setting environment variables without administrator rights in Windows 10, I think I have found a way. I was not administrator and could use PowerShell.

PowerShell method

You can list all environment variables with: Get-ChildItem Env:.

To get the value of a specific variable: $Env:PATH, where PATH is the name of the variable.

To set a variable: [Environment]::SetEnvironmentVariable("PATH", "C:\TestPath", "User"), the first parameter is the name of the variable, the second is the value, the third is the level of.

There are different ways to work with environment variables and certain quirks with them in PowerShell so consult the link for details.

Old method (no longer available in newer Windows 10 updates, use PowerShell or see other answers)

Go into Settings and click on System.

Then on the left side click About and select System info at the bottom.

In the new Control Panel window that opens, click Advanced system settings on the left.

Now in the new window that comes up, select Environment Variables... at the bottom.

2 of 9
127

Still the same as ever: It’s in the old-style control panel’s “System” thingy. You can reach it with WinBreak or by right-clicking the Start button.

From there, select “Advanced system settings” → “Environment Variables”.

Or you can do it the hard way and find some other entry point to the old-style control panel, like the Network and Sharing Center or the Desktop folder(!).

🌐
GitHub
gist.github.com › mitchmindtree › 92c8e37fa80c8dddee5b94fc88d1288b
How to permanently set user environment variables on Windows · GitHub
Using the command prompt: setx FOO "path\to\foo" Using powershell: [Environment]::SetEnvironmentVariable("FOO", "path\to\foo", [System.EnvironmentVariableTarget]::User) Using the windows GUI.
🌐
NinjaOne
ninjaone.com › home › blog › it ops › how to view and manage environment variables in windows
How to View and Manage Environment Variables In Windows | NinjaOne
March 12, 2026 - Type [System.Environment]::SetEnvironmentVariable(“MY_VAR”, “TestValue”, “Machine”) and press Enter. Remember: Use “User” for variables that apply only to your account or “Machine” for variables that apply to the entire system.
🌐
Twilio
twilio.com › en-us › blog › how-to-set-environment-variables-html
How to Set Environment Variables | Twilio
December 9, 2025 - Below, we'll show you how to set environment variables on macOS, Linux, and Windows, plus how to use .env files for project-specific configuration. Environment variables, as the name suggests, are variables in your system that describe your environment. The most well known environment variable is probably PATH which contains the paths to all folders that might contain executables. With PATH, you can write just the name of an executable rather than the full path to it in your terminal since the shell will check the local directory as well as all directories specified in the PATH variable for this executable.
🌐
Microsoft Learn
learn.microsoft.com › en-us › powershell › module › microsoft.powershell.core › about › about_environment_variables
about_Environment_Variables - PowerShell | Microsoft Learn
When you change environment variables in PowerShell, the change affects only the current session. This behavior resembles the behavior of the set command in the Windows Command Shell and the setenv command in Unix-based environments.
🌐
Configu
configu.com › home › setting env variables in windows, linux & macos: beginner’s guide
Setting Env Variables in Windows, Linux & MacOS: Beginner’s Guide - Configu
March 13, 2025 - In the Environment Variables window, choose between User variables (for the current user only) and System variables (for all users). Click New…, enter the variable name and value, and click OK. To create a user-specific environment variable, use: ... Note: Changes take effect in new Command Prompt sessions. Restart the terminal or log out and back in to apply them.
🌐
IBM
ibm.com › docs › SSGU8G_12.1.0 › com.ibm.sqlr.doc › ids_sqr_193.htm
Setting environment variables on Windows
Build, govern, and manage your data for generative AI solutions · Use pre-integrated automation technologies to design, build, and run automation applications and services on the cloud