The Command Prompt is a command-line interface (CLI) in Windows operating systems that allows users to enter and execute commands. It can be used for various tasks, such as troubleshooting, system maintenance, and automation.
- Using Start Menu: Type
cmd
in the search box and press Enter. - Using Run Dialog: Press
Windows key + R
, typecmd
, and press Enter.
Once open, you can enter commands and press Enter to execute them.
ctrl+c
: Stops all running programs in the Command Prompt.dir
: Displays the contents of the current directory.del
: Deletes specified files.type
: Displays the contents of a file.netstat
: Displays active network connections.ipconfig
: Displays the IP configuration of the system.md
: Creates a new directory.rd
: Removes a directory.rename
: Renames a file or directory.time
: Displays or sets the system time.date
: Displays or sets the system date.systeminfo
: Displays system information, such as the OS version and installed hardware.tasklist
: Displays a list of running tasks and their status.taskkill
: Terminates a running task.echo
: Displays a message or the value of a variable.ping
: Tests connectivity to a specific IP address or hostname.sfc
: Scans and repairs system files. Usesfc /scannow
for a full scan.set
: Displays or sets environment variables.shutdown
: Shuts down or restarts the computer.route
: Displays and modifies the IP routing table.driverquery
: Displays a list of installed device drivers.netdom
: Manages domain and trust relationships.nbtstat
: Displays protocol statistics and current connections using NetBIOS over TCP/IP.sc
: Manages Windows services.reg
: Manages the Windows Registry.fsutil
: Performs various file system tasks.diskpart
: Manages disks, partitions, and volumes.compact
: Compresses or uncompresses files and folders.robocopy
: Copies files and directories (robust file copy).xcopy
: Copies files and directories, including subdirectories.find
: Searches for a specific text string in a file or files.certutil
: Manages certificates and certificate trust lists.cipher
: Manages encryption of files and folders.lpksetup
: Installs and manages language packs.ocsetup
: Installs and manages optional components.pkgmgr
: Installs and manages packages.powercfg
: Configures power settings.winsat
: Tests and displays the computer’s current performance rating.sfc /scannow
: Performs a full scan of the computer for bugs and system health.
Lists the contents of the current directory.
- Usage:
dir
- Example:
dir C:\Users
Displays network configuration details, such as IP address, subnet mask, and default gateway.
- Usage:
ipconfig
- Example:
ipconfig /all
Tests the connectivity to a specific address or hostname.
- Usage:
ping [address]
- Example:
ping google.com
Ends a task or process.
- Usage:
taskkill /IM [process_name] /F
- Example:
taskkill /IM notepad.exe /F
Manages disks, partitions, and volumes.
- Usage:
diskpart
- Type
list disk
to display available disks. - Type
select disk [number]
to choose a disk. - Type
create partition primary
to create a partition.
- Type
- Customizing Commands: Many commands support additional arguments and flags. Use
[command] /?
to see available options. - Accessing Command History: Use the up and down arrow keys to navigate through previously entered commands.
- Admin Privileges: Some commands require administrative rights. Run Command Prompt as an administrator by right-clicking it and selecting "Run as administrator."