How to set env variable in windows cmd




















When you add an environment variable in Windows, the key-value pair is saved in the registry. The default registry folders for environment variables are:. Using the reg command allows you to review and unset environment variables directly in the registry. Run the setx command again to propagate the environment variables and confirm the changes to the registry.

For example:. After following this guide, you should know how to set user-specific and system-wide environment variables in Windows Looking for this tutorial for a different OS? It is then helpful to be able to see what environment variables are set already. This is how you do it:. To set persistent environment variables at the command line, we will use setx. Prior to that, it was part of the Windows Resource Kit.

To use the set command in a batch program to add a new directory to the PATH environment variable, type:. To display a list of all of the environment variables that begin with the letter P , type:.

Skip to main content. This browser is no longer supported. Download Microsoft Edge More info. Contents Exit focus mode. Deleting a system variable requires administrator privileges. If there were other variables to set, we could just do that now.

However if we were just interested in unsetting variables, we will need to have one variable left behind. Neither download is supported on bit version. Print environment variables You can use environment variables in the values of other environment variables.

Warning This method is recommended for experienced users only.



0コメント

  • 1000 / 1000