Skip to content

How to Display Environment Variable Contents in Windows Command Prompt

  • by

Environment variables are a crucial part of the Windows operating system, as they store important information such as system paths, user preferences, and configuration settings. Sometimes, it becomes necessary to view the contents of these variables for troubleshooting or debugging purposes. You can always go to Environment variable settings and see its value; however a much faster approach is to see its value using command prompt.

Steps to display the contents of an environment variable from CMD:

  1. Open the command prompt by pressing the Windows key + R, typing “cmd” in the Run dialog box, and hitting Enter.
  2. Type “echo %VARIABLE_NAME%” without the quotation marks.
  3. Replace “VARIABLE_NAME” with the name of the environment variable you want to view. For example, to view the contents of the “PATH” variable, you would type “echo %PATH%”.
  4. Press Enter, and the command prompt will display the contents of the specified environment variable.

It is important to note that the variable name is case-insensitive, so you can use uppercase or lowercase letters interchangeably.

This method allows you to quickly and easily view the contents of any environment variable without the need for additional tools or software. It is especially useful when troubleshooting issues related to paths or configuration settings.

By following these simple steps, you can easily display the contents of an environment variable from the command prompt in Windows.

Leave a Reply

Your email address will not be published. Required fields are marked *