The Windows console is a bit scary at first, but a handful of commands solves problems that take much longer through windows: repairing damaged files, checking the disk, closing a frozen program or seeing battery health. This guide gathers the most useful system commands, explained for beginners.
In short
- On Windows 11 everything opens from Terminal: right-click Start › Terminal (Admin).
- To repair Windows: first
DISM ... /RestoreHealth, thensfc /scannow.chkdskchecks the disk for file system errors.tasklist,taskkillandshutdowncontrol programs and shutdowns.- Most CMD commands also work in PowerShell.
CMD, PowerShell and Terminal: what is what
- Command Prompt (CMD): the classic console inherited from MS-DOS. Simple and compatible with everything.
- PowerShell: the modern console. It understands almost all CMD commands and adds its own (cmdlets), in
Verb-Nounform. - Terminal: the app that on Windows 11 opens both in tabs. It is the default.
Many commands here need administrator rights. Open the console like this: right-click Start (or Windows + X) › Terminal (Admin) and accept the prompt.

Repair Windows: DISM and sfc
If Windows acts strange, freezes or updates fail, these two commands are the first step. Order matters.
- DISM repairs the Windows image, the reference copy the system uses:
DISM /Online /Cleanup-Image /RestoreHealth
- sfc compares system files with that image and replaces damaged ones:
sfc /scannow
DISM can take 10–20 minutes and seem stuck at some percentage: wait. When sfc finishes, read the final message. If it found and repaired damaged files, restart.
If you only want to check without repairing, DISM has two lighter options: /CheckHealth (quick) and /ScanHealth (thorough).
Check the disk: chkdsk
chkdsk finds and fixes file system errors on a drive.
chkdsk C:
chkdsk C: /f
chkdsk C: /r
- Without parameters it only reads and reports.
/ffixes errors./ralso looks for bad sectors. Much slower, especially on large hard drives.
On drive C: it cannot work while Windows runs, so it asks to schedule it for the next restart. Answer Y and restart.

System information
| Command | Purpose |
|---|---|
winver | Exact Windows version in a window |
systeminfo | Summary: model, RAM, install date, patches |
hostname | Computer name |
powercfg /batteryreport | Laptop battery health report |
Get-ComputerInfo | Detailed info (PowerShell) |
Get-PhysicalDisk | Drives, type (SSD/HDD) and health (PowerShell) |
powercfg /batteryreport saves a battery-report.html file in the current folder. Open it and compare Design capacity with Full charge capacity: the difference is wear.
To get the computer’s serial number or the key stored in BIOS, see recover the BIOS serial number.
Programs and processes
View what is running and close a frozen program:
tasklist
taskkill /IM notepad.exe
taskkill /IM notepad.exe /F
/F forces closing: unsaved work is lost. In PowerShell the equivalent is:
Get-Process
Stop-Process -Name notepad
To install and update programs from the console, the tool is winget; see the winget guide.
Shut down and restart
shutdown /s /t 0
shutdown /r /t 0
shutdown /s /t 3600
shutdown /a
/sshuts down,/rrestarts and/tsets the wait in seconds.shutdown /s /t 3600shuts down in an hour.shutdown /acancels a scheduled shutdown.
For repeated tasks (shutting down every night, for example), Task Scheduler is better.
Moving around folders
The basics to not get lost in the console:
| Command | What it does | Example |
|---|---|---|
dir | Lists contents | dir |
cd | Changes folder | cd Documents · cd .. |
mkdir | Creates a folder | mkdir Backups |
copy | Copies files | copy note.txt D:\ |
move | Moves or renames | move note.txt Backups |
del | Deletes files | del note.txt |
cls | Clears the screen | cls |
Careful with del: what it deletes does not go to the Recycle Bin. To copy or sync whole folders, use robocopy.
If a path has spaces, quote it: cd "C:\Program Files".
Two time-saving tricks: press Tab so the console completes a folder or file name, and use the ↑ and ↓ arrows to recall previous commands without retyping. In PowerShell, Tab also completes command and parameter names.
Variables in paths
Long paths are shortened with environment variables. For example, cd %USERPROFILE% in CMD (or cd $env:USERPROFILE in PowerShell) takes you to your user folder whatever its name. To learn what they are and how the PATH variable works, see environment variables in Windows.

And for the network
Network commands (ipconfig, ping, tracert, nslookup…) have their own guide: Windows network commands explained.
Frequently asked questions
Can I break something with these commands? sfc, DISM and chkdsk are meant to repair and are safe. The ones that can harm are those that delete (del, rmdir) or force close: check what you type before pressing Enter.
It says “Access denied” or “requires elevation”. You opened the console without rights. Close it and open with Terminal (Admin).
How do I see a command’s help? In CMD add /? (for example chkdsk /?). In PowerShell, Get-Help Stop-Process.
sfc found errors but could not repair them? Run DISM with /RestoreHealth first, restart and run sfc /scannow again. If it persists, you may need to repair Windows from an installation USB.



