Windows – command to refresh environment variables from the command prompt in Windows

cmdenvironment-variableswindows

If I modify or add an environment variable I have to restart the command prompt. Is there a command I could execute that would do this without restarting CMD?

Best Answer

On Windows 7/8/10, you can install Chocolatey, which has a script for this built-in.

After installing Chocolatey, just type refreshenv.