If a new terminal window still shows the old variables, look at the parent application. Are you opening a terminal inside VS Code, ConEmu, or IntelliJ? You must restart that parent application. It is holding the stale environment block and passing it down to its children.

If you are scripting the variable change via the command line (using setx ), this broadcast does not happen automatically. You can trigger it programmatically using PowerShell: powershell

Sometimes explorer.exe (the graphical shell) gets stuck. You can restart Explorer without rebooting the whole PC.

If you have Chocolatey installed, run refreshenv . If you are a PowerShell user without Chocolatey, run this one-liner to force the current session to sync with the registry: