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 Answer
This provides CMD specific commands.
help
and to page the output use this
help | more
2 Comments
Mathias Bynens
Thanks. That doesn’t seem to list all available commands, though. Is there a way to include things like
con2prt, msinfo32, regsvr32, rundll32 etc.?Stephan
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%
compgen -cin WSL to see what it looked like and the output included Windows programs (together with DLLs) xD