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?

1
  • 1
    Funny... I ran compgen -c in WSL to see what it looked like and the output included Windows programs (together with DLLs) xD Commented Jul 13, 2019 at 18:14

1 Answer 1

2

This provides CMD specific commands.

help

and to page the output use this

help | more
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks. That doesn’t seem to list all available commands, though. Is there a way to include things like con2prt, msinfo32, regsvr32, rundll32 etc.?
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%

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.