The 30 most useful Command Prompt commands for editing files and managing your PC

Typing on computer with spreadsheets
If you’re going to use the Command Prompt, you need to know its commands. Chalirmpoj Pimpisarn/EyeEm/Getty Images
  • Command Prompt commands let you manage your computer just by typing.
  • Some Command Prompt commands let you move files, while others let you change your internet settings.
  • Here are some of the most useful Command Prompt commands, and what they do.
  • Visit Insider’s Tech Reference library for more stories.

The Command Prompt isn’t pretty, but it’s one of the most powerful apps on your PC. With it, you can move or delete files, change your Wi-Fi settings, lock your hard drive, and even shut down the computer.

But to use Command Prompt, you’ll need to know the commands for it. Here are some of the most useful commands, along with explanations of what they’ll do.

The essential Command Prompt commands

We’ll sort these commands into a few different groups, based on what they’re used for.

Hands typing on laptop keyboard PC
Basic commands include closing apps and moving files. Carolyn Ann Ryan/Getty Images

Managing your apps

Command What it does
At Lets you schedule apps or other commands to run at a specific date and time
Msiexec Starts Windows Installer, an app that helps you properly install software
Taskkill Ends a program or process that you specify
Tasklist Shows you every app, service, and process currently running on your computer

Editing files

Command What it does
Assoc Lets you change which programs are used to open different types of files
Comp Compares two or more files, or sets of files
Del Deletes a specified file
Makecab Creates a CAB file, which can compress and store data just like a ZIP file
Move Lets you move files from one folder to another
Print Sends a specified text file to a specified printer
Recover Scans a specified disk and retrieves all the readable data on it – great for recovering files from corrupted hard drives
Robocopy Lets you copy files, folders, and more from one location to another
Tree Shows you the folder structure for a specified drive or location

Businesswoman using desktop PC computer at office
Some Command Prompt commands let you troubleshoot computer or internet issues. Richard Drury/Getty Images

Managing Windows

Command What it does
Chdir Tells you the name of the directory you’re currently working from, and lets you change it
Chkdsk Scans your hard drive for errors and tries to fix them
Cmdkey Lets you view, create, or delete stored usernames and passwords
Defrag Defragments the hard drive, reorganizing the files to make data retrieval faster and more efficient
Driverquery Gives you a list of all the drivers installed on your computer
Format Formats a specified drive, erasing all the data on it
Ipconfig Shows details about your internet connections, and lets you refresh your IP addresses
Net Lets you view and edit network settings
Reg Lets you manage the Windows Registry by adding keys, exporting data, and more
Sfc Scans, verifies, and replaces important Windows system files
Shutdown Lets you shut down or restart your computer
Ver Shows the current Windows version number
Vol Tells you the volume label and serial number of a specified hard drive

Miscellaneous

Command What it does
Clip Automatically copies the output of any command to the clipboard
Cls Resets the Command Prompt and clears all the text
Color Lets you change the Command Prompt’s text and background colors
Help Generates a list of example commands, just like this one

How to zip and unzip files in Windows 10Alt + F4: The Windows keyboard shortcut for closing applications, explainedWhat is Secure Boot? A guide to your PC’s security check during startupHow to check the power supply on your PC, a crucial step before upgrading it