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?
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.
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.
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.
On Windows 7/8/10, you can install Chocolatey, which has a script for this built-in.
After installing Chocolatey, just type refreshenv
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With