In the beginning, all we had was the command line. Then as Windows matured, the need to access that throwback interface waned.
That doesn’t mean the Command Prompt is completely useless. In fact, recent versions of Windows have introduced new commands. And while Windows 10’s graphical interface is generally straightforward to use, several features are still faster to execute through that last tie to MS-DOS. The same goes for accessing a few pieces of useful information, too.
We’ve listed our top Command Prompt commands below, but don’t take this list as the complete lineup of useful commands. If you like to kick it old-school, there are still plenty worth your time. For most people, though, these six will add efficiency to your regular routine without requiring excessive time in a command line interface.
To open the Command Prompt, tap the Windows key, then enter cmd.
On its own, the echo command has little relevance for the overwhelming majority of Windows users. (The PCWorld staff included.) But we like using one specific application of it:
echo off | clip.
Entering this string into the Command Prompt clears the last item on your Clipboard—helpful when you’ve copied sensitive information and are done with it. (This command won’t clear your full Clipboard history though, so you’ll have to use Windows 10’s Clipboard settings to do that. You can also turn off history while you’re in that menu.)
An alternative way to use this command is to open Windows 10’s Run command window (Win + R) and enter cmd /c “echo off | clip”. If you never use Run for anything else, it’ll remember this command whenever you next call it up, making it slightly faster than opening a fresh Command Prompt window each time.
The powercfg command can be of use to both desktop PC and laptop owners, especially if you need to toggle the hibernation feature (
powercfg /hibernate) or begin an investigation into what’s disturbing your computer from sleep (
But laptops benefit the most from the gem among powercfg’s operations: the battery report (
powercfg /batteryreport). If you’ve felt like your battery life has taken a sudden dip, this information will share the battery level at certain points in time, along with the time it recently took to drain since last plugged in. By default, the report will save to your Windows 10 user folder under the name "battery-report.html"
On its own,
ipconfig gives a brief readout of the active networking hardware’s local IP address—useful for identifying your PC when looking separately at your router’s list of connected devices.
But the real beauty of ipconfig is when Windows 10’s network troubleshooting isn’t fixing your connection woes and you need to manually release (
ipconfig /release) and renew (
ipconfig /renew) your IP address. You can also see full detailed information of all of your networking hardware, including the MAC address for when you need to add it to a whitelist, whether or not it’s connected (
Can’t connect to a website and want to tell whether it’s you or the site? (As much as we wish it knew everything, downdetector.com doesn’t always catch every outage.) Use tracert to both test the connection and see where in the journey the trouble is, if any exists (
tracert [website address or ip address]).
The tracert command functions similarly to
ping in that it sends out data packets to the site and waits for a response, but it also reports the details of the journey that the data takes. If a communication attempt times out, you’ll see where in the trip it happens, helping you to troubleshoot. For example, if you can’t even reach the first hop—your router—then you’ll want to start by looking at your connection to your home network.
Ping is better for answering the question “Is there a connection and how fast is it?”, while tracert answers both that and “Where does the connection fail?”. It’s more rare that we want only the information that ping reveals, hence tracert’s place on this list.
When parts of the Windows interface start acting up—say, disappearing taskbar icons—it may be time to lean on the System File Checker. Running
sfc /scannow will check for corrupted files on your system and attempt to repair any files with problems.
To open a Command prompt as an administrator, hit the Windows key or click on Start button, then type cmd. Right-click on the result for the Command Prompt, then choose Run as administrator. As a a slightly faster alternative, you can also open a PowerShell window as an administrator (Win+X or right-clicking on the Start button). It’ll work the same as the Command Prompt.
You may already be familiar with
chkdsk. After an unexpected shutdown, Windows will sometimes halt a reboot to run chkdsk, in order to check for bad sectors and repair errors on the disk. If you suspect that one of your drives may have issues, you can initiate this same scan manually as well.
Open a Command Prompt as an administrator, then enter chkdsk to begin a read-only scan. You can also add a drive letter to specify which storage disk to check (e.g.,
chkdsk D:) and/or a switch to fix errors on disk (e.g.,
chkdsk /f), locate bad sectors and recover readable information (e.g.,
chkdsk /r), run an online scan on an NTFS volume (e.g.,
chkdsk D: /scan), and more. (Use
chkdsk /? to get the full list of available switches.)