List all environment variables from the command line

前端 未结 8 1419
星月不相逢
星月不相逢 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条回答
  •  情话喂你
    2020-11-28 17:42

    To list all environment variables in PowerShell:

    Get-ChildItem Env:
    

    Or as suggested by user797717 to avoid output truncation:

    Get-ChildItem Env: | Format-Table -Wrap -AutoSize
    

    Source: Creating and Modifying Environment Variables (Windows PowerShell Tip of the Week)

提交回复
热议问题