What is the difference between command line and cmd?

I have Windows 7, Windows 8, and Windows 10 systems, and they all behave the same.

When I type the command line on the Start menu and press Enter, the Command Line window appears. I gave him a blue background and green text. When I enter start, cmd or the bat file name on the command line, it opens a window with the name cmd, which I gave a background of black and green text. It seems that the colors are stored, but ... hmm ...

When I enter cmd into the Windows 10 start menu, a window called "cmd" appears, but it resembles the blue background and green text in the command window, but entering cmd from this window opens a new black and green. When I double-click the batch file, it opens a window with the name of the command line with a different font and a black background with white text. When I type command , it just prints the DOS and copyright headers, but start command opens a window called COMMAND.COM with a different font and a black background with white text.

When the type cmd /? on the screen to the parameter list. One of them is / Q. It says that in a new instance it is disconnected. When I type cmd /Q at the command line or cmd, it replaces this window with a different one, using the same title but black and green color scheme, and DOES not turn off the echo. When I type start cmd /q , the same thing happens, but "start cmd.exe / q" actually throws an error stating that / Q is not a valid switch.

This is really only part of the problem that I am facing, and I canโ€™t even start sorting it. If any veteran who knows all the subtle differences between the seemingly grove of the team's prompts and how to call them, I would appreciate if this person sorted this mess for me.

+6
source share
2 answers

I will try to eliminate some confusion, but I cannot do the perfect job because Microsoft did everything possible to completely unravel the mess, and they change the mess with each version of the windows. So, for example, some of the information I'm going to provide may not apply to Windows 8 and Windows 10. But it spread all the way to Windows 7.

The "command line" is the formal name of the console application under the windows. "cmd.exe" (or simply "cmd") is the name of the binary executable file of the same application.

Windows saves the default settings for the command line in the registry under HKEY_CURRENT_USER\Console . When a new command window opens, the windows accept the window title of this command prompt and try to find out if there is a subcategory under HKEY_CURRENT_USER\Console\ with this name. If he finds a subkey, he reads the values โ€‹โ€‹from it. If it does not find the subkey, it reads the default values โ€‹โ€‹found in HKEY_CURRENT_USER\Console .

For example, on my system there is a key HKEY_CURRENT_USER\Console\MySQL 5.6 Command Line Client - Unicode , most likely because the MySQL installer created this key so that their command line looks different than other command line instances. Of course, for this to work, a shortcut that launches its command line must specify the "MySQL 5.6 Command Line Client - Unicode" as the title bar of the command line window.

So, if you see command prompts with a different style, perhaps because you have entries in HKEY_CURRENT_USER\Console\ . And the fact that it does not seem to make any sense is due to the fact that the selected subsection depends on the name of the command window, which may differ depending on how you run it.

+9
source

The command line is just a shortcut to cmd.exe called "Command Line":

enter image description here

Styling is the result of a shortcut that has its own properties. You can also use other shortcuts for cmd.exe, and each of them can have its own style options.

As for the window name, cmd simply sets the window title for the name of the file in which cmd is running. If you create a shortcut for cmd.exe and name it "my_shell". You will get a cmd window called "my_shell".

+6
source

All Articles