The command prompt is the Windows operating systems command-line interpreter which is available for all of the modern Windows operating systems. Command prompt is the generic name where there are also alternative names like cmd.exe, MS-DOS, etc even they are different than command prompt but related to the command prompt. cmd.exe is the interpreter executable or applications used to interpret and run provided strings as commands in the command prompt and MS-DOS is the ancient and command-line based operating system which is operated via command prompts and command line.
Command Prompt vs MS-DOS vs CMD.exe
The terms MS-DOS and cmd.exe are used to with the same meaning of the command prompt. Even they are very related with each other they are different things. But as a common usage you can easily use these terms for each other interchangibly.
MS-DOS is an ancient time Windows operating system which do not provides a GUI originally. MS-DOS is mainly used with commands. But later versions MS-DOS provided a simple GUI which provides very basic color palette. As a command line operating system MS-DOS is also called as Command prompt in some cases.
cmd.exe is the executable tool or application which interprets provided commands and executed them accordingly. cmd.exe is the core of the command prompt where the command prompt is the GUI and window of the cmd.exe.
What Can I Do with Command Prompt?
Command prompts provides a lot of commands and functions in order to accomplish different tasks and things. Below we will list some popular use cases for command prompt.
- Create Directory/File/Folder
- Remove Directory/File/Folder
- List Directory/File/Folder
- Add/Change/Delete User
- Execute and Run commands, scripts
- Open GUI tools and applications
Open Windows Command Propmpt
Command prompt can be opened in different ways. where the easiest and popular way is using the
Start Menu . Open the start menu and type
command prompt or
cmd which will list the command prompt.
Run menu can be used to open the command prompt. Press the
WIN+R keyboard short cut to open Run menu and type
cmd.exe like below.
Windows Command Prompt Configuration and Properties
As a command line interface the Command Prompt do not provides a lot of components and configuration. But some configuration and property change is provided via
Properties like below.
The main configuration categories for command prompt are
From the Options tab you can change following configurations;
- Cursor Size can be set to small, medium, and large where small is the default size.
- Command history size can be changed to store previously typed commands and outputs.
- Edit options like quick edit, insert mode, enabling line wrapping can be set.
Font tab following configuration about command prompt can be changed.
- Font Size
- Font type like Courier New, MS Gothic etc.
Layout tab will provide following configuration
- Screen size or width and height
- Default window position top and left location
Colors tab provides following configuration,
- Screen text color
- Screen background-color
- Selected popup text and background-color
- Opacity etc.
Terminal tab provides following configurations.
- Terminal colors
- Cursor shape where legacy style, underscore or vertical bar can be set.
- Disable or enable terminal scrolling
Run Command/Executable/Script From Command Prompt
A command prompt is used to run or execute command, executable, or script easily. Running them will generally create a process that will execute accordingly. First run a command from the command line is like below.
C:\>dir Volume in drive C has no label. Volume Serial Number is 801B-D913 Directory of C:\ 12/07/2019 12:14 PM <DIR> PerfLogs 10/07/2020 03:07 AM <DIR> Program Files 10/07/2020 03:07 AM <DIR> Program Files (x86) 08/26/2020 08:02 AM 28 test.py 10/06/2020 04:10 PM <DIR> Users 10/06/2020 04:23 PM <DIR> Windows 10/06/2020 04:23 PM <DIR> Windows.old 1 File(s) 28 bytes 6 Dir(s) 63,023,083,520 bytes free
Executables are files which can be executed directly and generally starts an applications. Executables can be run providing the complete path of the executable file like below.
A script that can be a batch file or MS-DOS script or Python script can be run providing the script file name like below. In the following example, we will run the Python script named
backup.py in the command prompt.
C:\>C:\users\ismail\Desktop\backup.py Hello Wisetut.com
List Files and Folders via Command Prompt
dir command is used to list files and folders in the current working directory or provided path. If you want to list files and folders in the current directory just use
dir command without any option like below.
If you want to list different path or specified path files and folders provide the path like below.
C:\>dir C:\users\ismail Volume in drive C has no label. Volume Serial Number is 801B-D913 Directory of C:\users\ismail 10/08/2020 03:26 PM <DIR> . 10/08/2020 03:26 PM <DIR> .. 08/26/2020 08:02 AM <DIR> .idlerc 08/26/2020 06:00 PM 178 .packettracer 10/06/2020 04:24 PM <DIR> 3D Objects 07/06/2020 11:34 AM <DIR> Cisco Packet Tracer 7.3.0 10/06/2020 04:24 PM <DIR> Contacts 10/06/2020 04:24 PM <DIR> Desktop 10/06/2020 04:24 PM <DIR> Documents 10/08/2020 02:44 PM <DIR> Downloads 10/06/2020 04:24 PM <DIR> Favorites 10/06/2020 04:24 PM <DIR> Links 10/06/2020 04:24 PM <DIR> Music 09/10/2020 11:27 AM <DIR> OneDrive 10/06/2020 04:24 PM <DIR> Pictures 05/21/2020 10:36 AM <DIR> PycharmProjects 10/06/2020 04:24 PM <DIR> Saved Games 10/06/2020 04:24 PM <DIR> Searches 09/25/2020 02:40 PM <DIR> Test 10/06/2020 04:24 PM <DIR> Videos 10/08/2020 03:26 PM <DIR> wisetut 1 File(s) 178 bytes 20 Dir(s) 63,021,707,264 bytes free