List all environment variables from the command line

前端 未结 8 1369
星月不相逢
星月不相逢 2020-11-28 17:01

Is it possible to list all environment variables from a Windows\' command prompt?

Something equivalent to PowerShell\'s gci env: (or ls e

相关标签:
8条回答
  • You can use SET in cmd

    To show the current variable, just SET is enough

    To show certain variable such as 'PATH', use SET PATH.

    For help, type set /?.

    0 讨论(0)
  • 2020-11-28 17:53

    Just do:

    SET
    

    You can also do SET prefix to see all variables with names starting with prefix.

    For example, if you want to read only derbydb from the environment variables, do the following:

    set derby 
    

    ...and you will get the following:

    DERBY_HOME=c:\Users\amro-a\Desktop\db-derby-10.10.1.1-bin\db-derby-10.10.1.1-bin
    
    0 讨论(0)
提交回复
热议问题