How to Print List Existing Environment Variable using Command Prompt in Microsoft Windows
Generally, there is list of environment variables available in a device which is running using Microsoft Windows as operating system. There is a certain way to print it in a command prompt. But apparently in this case, the command for printing it will still use Power Shell tool as part of the command itself.
Table of Contents
- Introduction
- How to Print List Existing Environment Variable using Command Prompt in Microsoft Windows.
- Test for Printing List of Existing Environment Variable
Introduction
For the main content of this article, it definitely just has a simple attempt. It will show how to print list of existing environment variable in a Command Prompt. Just run the Command Prompt first and following after that, just print the command.
How to Print List Existing Environment Variable using Command Prompt in Microsoft Windows
As for the main step to print list of existing environment variable, below are the steps for achieving it :
-
Just run the command prompt. Search it using the search feature exist in the device. Just type ‘command prompt’ in the search textfield and then click the link which appear as the search result. In the search result, there is a link for running command prompt. Below is the appearance of the command prompt :
-
For printing a temporary environment variable, below is the pattern or the format for doing it :
powershell ls env:
Using the above command, just type it in a Command Prompt for printing list of environment variable.
Test for Printing List of Existing Environment Variable
In the previous section, there is already a step for running a Command Prompt and also the command for aiming the purpose for printing list of existing environment variable. So, the following is the actual execution of the command :
-
When the Command Prompt appear an run as it is mentioned in the previous section, the appearance will be just as follows :
Microsoft Windows [Version 10.0.22621.2861] (c) Microsoft Corporation. All rights reserved. C:\Users\Personal>
As for the command to print list of existing environment variable, just type the command mentioned in the previous section :
powershell ls env:
Part of the command, there is a syntax command using ‘powershell’. Apparently, in that command, printing the existing list of environment variable in the Command Prompt, it still use Power Shell.
-
Do not forget to press ‘Enter’ after typing the commmand in the Command Prompt. The following output of the executed command will appear :
Microsoft Windows [Version 10.0.22621.2861] (c) Microsoft Corporation. All rights reserved. C:\Users\Personal> powershell ls env: Name Value ---- ----- ALLUSERSPROFILE C:\ProgramData APPDATA C:\Users\Personal\AppData\Roaming CommonProgramFiles C:\Program Files\Common Files CommonProgramFiles(x86) C:\Program Files (x86)\Common Files CommonProgramW6432 C:\Program Files\Common Files COMPUTERNAME ComSpec C:\WINDOWS\system32\cmd.exe DriverData C:\Windows\System32\Drivers\DriverData EFC_ FPS_BROWSER_APP_PROFILE_STRING Internet Explorer FPS_BROWSER_USER_PROFILE_ST... Default GDAL_DATA C:\Program Files\PostgreSQL\14\gdal-data HOMEDRIVE C: HOMEPATH \Users\Personal INTEL_DEV_REDIST C:\Program Files (x86)\Common Files\Intel\Shared Libraries\ JAVA_HOME C:\Program Files\Java\jdk-17.0.2 LOCALAPPDATA C:\Users\Personal\AppData\Local LOGONSERVER MIC_LD_LIBRARY_PATH C:\Program Files (x86)\Common Files\Intel\Shared Libraries... NUMBER_OF_PROCESSORS OS Windows_NT Path C:\Program Files (x86)\Common Files\Intel\Shared Libraries... PATHEXT .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.CPL POSTGIS_ENABLE_OUTDB_RASTERS 1 POSTGIS_GDAL_ENABLED_DRIVERS GTiff PNG JPEG GIF XYZ DTED USGSDEM AAIGrid PROCESSOR_ARCHITECTURE PROCESSOR_IDENTIFIER Intel64 Family PROCESSOR_LEVEL PROCESSOR_REVISION ProgramData C:\ProgramData ProgramFiles C:\Program Files ProgramFiles(x86) C:\Program Files (x86) ProgramW6432 C:\Program Files PROJ_LIB PROMPT $P$G PSModulePath C:\Users\Personal\Documents\WindowsPowerShell\Modules;C... PUBLIC C:\Users\Public SESSIONNAME Console SystemDrive C: SystemRoot C:\WINDOWS TEMP C:\Users\Personal\AppData\Local\Temp TMP C:\Users\Personal\AppData\Local\Temp USERDOMAIN USERDOMAIN_ROAMINGPROFILE USERNAME Personal USERPROFILE C:\Users\Personal VBOX_MSI_INSTALL_PATH C:\Program Files\Oracle\VirtualBox\ windir C:\WINDOWS ZES_ENABLE_SYSMAN C:\>
Check for the way to do it in a video exist in this link. Either way, just check it in this following embedded video :