Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In Windows Vista,

Start->Run->cmd

opens cmd.exe

Where can I find a list of all the commands that can be executed there?

Today only I found out about getmac. I used to use ipconfig/all. getmac is so much more convenient.

share|improve this question
    
Use: where *.exe From: stackoverflow.com/questions/10665875/… –  Patrick Jul 2 '12 at 10:12
add comment

6 Answers

up vote 3 down vote accepted

As others have pointed out, "dir *.exe /s" will find you all the EXEs on the drive, and assuming you have permissions to do so, you can execute all of them directly (so long as you include an absolute path).

And the "help" command gives you a listing of basic MS built-ins.

But assuming you want a real answer, of a) a list of actual commands that b) you don't need full pathnames to run and c) include everything on YOUR system, not just Microsoft's tools, you need to discover it programmatically.

I don't know how to do this in DOS (or CMD), but I can give you the steps.

  1. For each directory in your PATH environment variable,
  2. list all files ending in the extensions listed in the PATHEXT environment variable.

When you type a command, PATH is a list of locations where Windows looks for that command, and PATHEXT is a list of file extensions it will append to that command to match to a file. Both are semicolon-separated lists, and both are searched in order. Here's my system:

PATH=c:\WINDOWS\system32;c:\WINDOWS;C:\cygwin\usr\local\bin;C:\cygwin\bin;C:\cygwin\bin;c:\Perl\bin\;c:\Python24;c:\Python24\bin;c:\WINDOWS\System32\Wbem;c:\Program Files\Common Files\GTK\2.0\bin;c:\bin
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH

You can probably guess I've made some modifications to my system PATH; yours will probably be less cluttered. (Or not; QuickTime and Java can't be the only programs that insist they need to add themselves to my path, so yours probably has some unexpected additions too.)

When I execute, say,

C:\> findstr

.. Windows searches each entry in the PATH variable for a file named "findstr" (case insensitive). It doesn't find that file in the first entry, so it checks for all possible permutations, by appending the extensions listed in PATHEXT to the command name and checking for that file. First it checks for "C:\WINDOWS\system32\findstr.com", but there's no such file. Next it checks "C:\WINDOWS\system32\findstr.exe" and finds it, so that's the program it runs.

Hopefully I wasn't trying to run "C:\WINDOWS\system32\findstr.bat" or "C:\bin\findstr.com" -- those files would have been run had I run one of these:

C:\> findstr.bat
C:\> findstr.com

... but since I only typed "findstr", I got the .EXE version.

So that's how Windows runs your commands on the commandline. If you want the full list of words you can type there and have run, you'll need to check your own PATH variable for where to look, and your own PATHEXT variable for what extensions to look for.

C:\> set | findstr PATH
PATH=C:\...
PATHEXT=...

(If anyone else wants to chime in with a succinct DOS commandline that will automate this, please weigh in!)

share|improve this answer
    
What an answer. Upvoted. :) –  Alexander Burke Mar 13 '10 at 8:59
add comment

In Windows Vista, Start->Run->cmd opens cmd.exe.
Where can I find a list of all the commands that can be executed there?

Typing

help

in the command prompt will give you a survey of the cmd commands, most left from the dos days. However, to get a list of everything that can be started from a cmd prompt (which is .exe, .com, .bat, .cmd and various executable files, like .pyc and so on, you'd have to do

c:\> dir *.exe,*.com,*.bat,*... /s

(this will also get you some browser cookies ending in .com, so ignore those)

share|improve this answer
    
Uh... I don't think that's what he meant by the second command you have there. –  Breakthrough Sep 30 '09 at 22:02
    
The second command will list every executable file on c:! While certainly you can execute them, only ones on one's path are really relevant when asking "What can I run?" - regular executables should be a given. –  Phoshi Sep 30 '09 at 22:22
    
He asked, and I quote "a list of all the commands that can be executed there". I know I maybe took it too literally, but technically, that's the one :) Anyways, edit the answer if you feel like it. I won't mind. –  ldigas Sep 30 '09 at 22:50
add comment

You can type "help" at the prompt and see most of the built in commands (plus some which are not built in, but are major ones).

That being said, there are a lot of "executables / batch / script" files such as anything ending in .exe, .com, .cmd.

However, I do not believe there is anyway of finding them all unless you just do a dir and pipe in all executables - however I doubt that would be effective.

share|improve this answer
add comment

Other commands here: http://ss64.com/nt/

share|improve this answer
add comment

Along with the help or /? after a command in question is prefer this site

http://commandwindows.com/vista-commands.htm

not only does it list all of them but you can click on the to get the sub commands for each and how its used

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.