Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

Required fields*

List all environment variables from the command line

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

Something equivalent to PowerShell's gci env: (or ls env: or dir env:).

Answer*

Cancel
3
  • 1
    Doesn't seem to work these days (in 2021) ` $ set $ cmdlet Set-Variable at command pipeline position 1 $ Supply values for the following parameters: $ Name[0]: $ Set-Variable: Cannot bind argument to parameter 'Name' because it is an empty array. ` Commented Mar 2, 2021 at 4:11
  • 5
    set is run in cmd, not Powershell @JayKilleen Commented Dec 16, 2021 at 16:28
  • So VERY very true @Grant! +1 But I think the MORE command option was to paginate. :D @JayKilleen and any other people: ---> Command Prompt CMD Answer: set | more (or in shortcut: set | more & pause) ---> PowerShell PS Answer: gci env: | Format-Table -Wrap -AutoSize -OR- Get-ChildItem Env: | Format-Table -Wrap -AutoSize
    – do loop
    Commented Jan 29, 2024 at 3:57