Environment variables are not often seen directly when using Windows. However there are cases, especially when using the command line, that setting and updating environment variables is a necessity.
I always new the set command line command to set environment variables in windows, but to make a system wide effect of the environment variable, this command needs users to logout and login again.
To set persistent environment variables at the command line, we can use setx.exe. It became part of Windows as of Vista/Windows Server 2008.
setx.exe does not set the environment variable in the current command prompt, but it will be available in subsequent command prompts.
for more info type the following in the windows command