How to reload environment variables (including PATH) in Windows Command line / cmd.exe

Published 2019-01-23, 18:30

Do you know all those installation instructions that tell you to restart your Windows console after installing a tool that adds itself to your PATH so its binary can directly be called?

Well, today I learned there is a much easier way to achieve this:

refreshenv
>refreshenv
Refreshing environment variables from registry for cmd.exe. Please wait...Finished..

Thanks to meteor for telling me about this in its Chocolatey/choco output:

Environment Vars (like PATH) have changed. Close/reopen your shell to see the changes (or in powershell/cmd.exe just type `refreshenv`).

15 queries. 0,093 seconds.