Environment variable in Windows

This tutorial is about creating environment variables in Windows using command prompt (CMD).

To create an environment variable

set FLASK_MAIL_ENABLED=false
set SECRET='hvjnbhfghfchdbhftbtg6tbyr4vew3wct4d54t'

To print environment variable

echo %FLASK_MAIL_ENABLED%

To list all environment variables

set

To append to existing environment variable (appending newly installed package to PATH env)

set PATH=%PATH%;C:\Users\Laptop\AppData\Local\Packages\PythonSoftware......p0\LocalCache\local-packages\Python311\Scripts

Note: set is not case sensitive, you can also use SET.

Last updated

Was this helpful?