The 30 most useful Command Prompt commands for editing files and managing your PC
- 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.
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.
Important: This is a list of base commands, some of which will work right away, some of which only work in specific situations, and most of which will only work if you add more text or commands afterwards.
It would be impossible to list every use case for each command, so if a certain command doesn't work right away, carefully read the error that Command Prompt gives you or do more research online for your specific use case. You can also type the command and then add a space and /? for examples of how to use it.
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 |
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 |
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 |