6

I’d like to programmatically get a list of all the available commands in Windows Command Prompt (cmd.exe). Is there something like compgen -c in Bash, but for Windows?

Community
  • 1
  • 1
Mathias Bynens
  • 144,855
  • 52
  • 216
  • 248

1 Answers1

2

This provides CMD specific commands.

help

and to page the output use this

help | more
foxidrive
  • 40,353
  • 10
  • 53
  • 68
  • 1
    Thanks. That doesn’t seem to list all available commands, though. Is there a way to include things like `con2prt`, `msinfo32`, `regsvr32`, `rundll32` etc.? – Mathias Bynens Mar 04 '14 at 06:36
  • 1
    `dir c:\windows\system32\*.exe` - but I'm quite sure, that's much more than you want (for example, there is also `calc.exe`). On the other hand - it IS a list of all available (external) commands - well, to be complete, you have to do it on all folders in your `%path%` – Stephan Mar 04 '14 at 07:31