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?
            Asked
            
        
        
            Active
            
        
            Viewed 7,449 times
        
    6
            
            
        
        Community
        
- 1
 - 1
 
        Mathias Bynens
        
- 144,855
 - 52
 - 216
 - 248
 
- 
                    1Funny... I ran `compgen -c` in WSL to see what it looked like and the output included Windows programs (together with DLLs) xD – Álvaro González Jul 13 '19 at 18:14
 
1 Answers
2
            This provides CMD specific commands.
help
and to page the output use this
help | more
        foxidrive
        
- 40,353
 - 10
 - 53
 - 68
 
- 
                    1Thanks. 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