Theme: iWiki Log in Register
Wiki page

Command Prompt

Last revised by LocalRoot - 22 Jun 2026, 13:11

Command Prompt is the traditional command-line interpreter included with Microsoft Windows. It is commonly opened through cmd.exe and is also known as the Windows Command Processor.

Command Prompt lets a user run text commands to manage files, start programmes, inspect network settings, run scripts and perform administrative tasks. It remains useful even though Windows PowerShell and Windows Terminal provide newer command-line experiences.

Purpose

Command Prompt provides a text interface to Windows. Instead of clicking through menus, a user enters commands and receives text output.

Common uses include:

  • Listing, copying, moving or deleting files.
  • Running diagnostic tools such as ping and ipconfig.
  • Starting programmes or scripts.
  • Managing environment variables.
  • Running batch files.
  • Troubleshooting Windows installations and recovery environments.

Opening Command Prompt

Command Prompt can be opened from the Start menu, the Run box, Windows Terminal, File Explorer's address bar, or administrative tools.

Some commands require an elevated session. An elevated Command Prompt is one opened with administrator rights. Commands that change system files, disk layout, boot configuration or protected settings may fail without elevation.

Basic Syntax

Most commands follow a simple pattern:

command option target

Examples include:

  • dir lists files and folders.
  • cd changes the current directory.
  • copy source destination copies a file.
  • del filename deletes a file.
  • ipconfig displays network configuration.
  • tasklist lists running processes.

Spaces matter. File paths that contain spaces should be wrapped in quotation marks, such as "C:\Users\Public\Documents".

Batch Files

Command Prompt can run batch files, usually ending in .bat or .cmd. A batch file is a text file containing commands that run in order.

Batch files are still used for simple automation, login scripts, legacy administration and compatibility with older tools. For complex automation, PowerShell is usually more capable because it works with structured objects and has a larger scripting language.

Safety

Command Prompt can delete files, change system settings and run programmes. A command copied from an unknown source should be read before it is run.

Particular care is needed with commands such as del, rmdir, format, diskpart, bcdedit and scripts that download and run remote code.

Relationship to MS-DOS

Command Prompt is sometimes casually called a DOS prompt, but modern cmd.exe is not MS-DOS. It is a Windows command interpreter descended from earlier command-line environments and used on Windows NT-based systems.

See Also

References

Discussion log

Use comments for sourcing notes, corrections, and disputed details.

No comments yet.