Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a command to refresh environment variables from the command prompt in Windows?

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?

like image 940
Eric Schoonover Avatar asked Oct 05 '08 06:10

Eric Schoonover


People also ask

How do I refresh environment variables in Windows?

2. Refresh Environment Variables via Command Prompt (CMD) Step 1: In the Start menu, search for Command Prompt and run it as an administrator. Step 2: Type the command: “set PATH = c” (without quotation marks), press the enter key, and restart the Command Prompt.

How do I check environment variables in CMD?

To Check if an Environment Variable ExistsSelect Start > All Programs > Accessories > Command Prompt. In the command window that opens, enter echo %VARIABLE%. Replace VARIABLE with the name of the environment variable.

Do environment variables need a reboot?

No, you don't need to restart your system. However, you have to restart your command prompt application to update the changes done on Environment variables.


1 Answers

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

After installing Chocolatey, just type refreshenv.

like image 81
jolly Avatar answered Oct 07 '22 20:10

jolly