Sunday, November 05, 2017

[Windows] Refreshing Environment variable for windows command prompt or Powershell

Sometimes, after installing a package like chocolatey,or npm packages, it asks you to restart the cmd.exe or powershell window to reload the new registered path, for the new commands/settings to work. 

Well most of the case, it is not a big issue, but sometimes I just hate having to do away with my command history. So whats an easy workaround to do, run refreshenv

In cmd.exe (Command Shell) run : 

C:\Windows\system32> refreshenv
Refreshing environment variables from registry for cmd.exe. Please wait... Finished..
In Powershell:


PS C:\Users\parag> refreshenv
Refreshing environment variables from registry for cmd.exe. Please wait...Finished..
PS C:\Users\parag>
Enjoy working in the same window without having to part with your command history. 

1 comment:

Kanchan Mishra said...

Its so interesting and life is unpredictable just like the wind. This such a nice lines to use it.

NIOS Admission 10th
NIOS Admission 12th

[Solved] Android Studio : Android emulator is incompatible with Hyper-V

Have been lately doing Android development. Ran into a minor problem. So I have two machines, a desktop and a laptop. I set the project on ...