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:
- Open the command prompt by pressing the Windows key + R, typing “cmd” in the Run dialog box, and hitting Enter.
- Type “echo %VARIABLE_NAME%” without the quotation marks.
- 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%”.
- 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.
C P Gupta is a YouTuber and Blogger. He is expert in Microsoft Word, Excel and PowerPoint. His YouTube channel @pickupbrain is very popular and has crossed 9.9 Million Views.