What the Command Prompt Really Does

written by: Johnny Stenthal; article published: year 2007, month 02;


In: Root » Computers and technology » Microsoft OS family » What the Command Prompt Really Does

Dutch French Spanish Portuguese Italian German Japanese Chinese Korean Russian Arabic Bookmark and Share this Article

When you use the Start menu to open a Command Prompt window, what's actually happening is that you're running a program named cmd.exe, the Windows command shell. Cmd is defined as a console application, as opposed to a GUI application, so as the program is started up, Windows opens a blank, black window. Cmd prints a prompt, a bit of text to indicate that it's waiting for you to type something; it might look like this:

C:\Documents and Settings\brian>  
When you respond by typing a command and pressing Enter, cmd looks at the first word in the line of text you typed. It interprets this as the name of the program you want to run. It searches for an executable program file with this name, and if it finds one, starts up the program. Any other text on the line you typed is provided to the program for it to interpret, according to its own conventions, telling it what you want it to do.

For example, if I type the command

ping www.mycompany.com  
cmd will search several standard folders for a program named "ping". It will find ping.exe, which is a network testing utility, in \windows\system32. Cmd will instruct Windows to run ping.exe and provide it with the additional text I typed, www.mycompany.com. Ping interprets this additional text as the name of another computer whose network connection I'd like to test. It will perform the network test and print a few lines into the Command Prompt window. When the ping program exits (finishes), cmd.exe prints another prompt, and the cycle starts over.

Disclaimer

1) E-articles is not responsible for the information contained by this article as well for any and all copyright infringements by authors and writers. E-articles is a free information resource. If you suspect this article for any copyright infringement, please read the terms of service and contact us to investigate the problem.
2) E-articles is not responsible for inaccuracies, falsehoods, or any other types of misinformation this article may contain and will not be liable for any loss or damage suffered by a user through the user's reliance on the information gained here.

link to this article