Affiliate links. I may earn a commission at no extra cost to you. #ad
People send a text file and say run all of it. I won’t. Command Prompt does have a fixed set of built-in commands. That set is the tables below, and the ones that delete are split into the danger box so they don’t sit next to dir. help prints a mix, built-ins plus programs like chkdsk and format, and it still skips some. Linux has no list like that. A live USB already has more programs than this page, and one install adds more. The Linux half is what I type when Windows won’t boot, not every program that exists.
Open the right window
diskpart needs the title bar to say Administrator, or it answers access denied. Right-click Command Prompt, Run as administrator. dir and the other built-in commands don’t care. An underlined command opens the manual in a new tab. It does not type the line for you.
A few of the old commands moved. wmic still runs on a lot of Windows 10 boxes. Windows 11 24H2 and later don’t include WMIC. Microsoft removed it, and it can’t be added back. If it says not recognized, that’s why. I don’t go install a feature just to get that word back. I open PowerShell as admin and use the line I wrote under it. Linux checks are from a live USB, the “try it” desktop, not an install. If the installer is the button you can see, you clicked the wrong one.
What each check is for
| What you see | What I type | What I don’t buy yet |
|---|---|---|
| Windows boots. I need to know if the disk is even there | echo list disk | diskpart | A new SSD. List it first. The NVMe post is the seating job. |
| Windows will not boot, so there is no prompt | A Linux live USB, then lsblk | A motherboard. I still haven’t seen the disk from outside Windows. |
| Disk shows up, but it hesitates or files corrupt | CrystalDiskInfo, or smartctl from the live USB | chkdsk /r. That one grinds a weak disk for hours. |
| Laptop, and I want a number on the pack | powercfg /batteryreport, saved to the desktop | A new battery because the report looks ugly. Look at the pack. Swollen is the other guide. |
| Random crashes, and the disk’s SMART is clean | Windows Memory Diagnostic is a hint. MemTest if it finds something, or the crashes keep coming | More RAM. The RAM post is the order. |
| Windows files are broken and the disk is healthy | DISM /RestoreHealth, then sfc /scannow again | Those two for a drive that isn’t in BIOS. They can’t see hardware that setup can’t see. |
Is the disk on the list
From an admin Command Prompt this prints the disks Windows can see, then quits. I use it because it doesn’t leave me sitting inside diskpart where the next word might be clean.
- echo list disk | diskpart
- A disk with a size, and a star under the GPT column or not, is a disk this Windows can see. No row means this Windows doesn’t see the stick. It does not mean the BIOS page is blank. Look for the model name the way the NVMe guide starts. Name there, diskpart empty: driver or VMD, not a new motherboard. Name nowhere: seating and slot, same guide.
- list disk doesn’t print letters. Look at Free. If Free is almost the whole Size, nothing is partitioned yet. That can be a blank stick, or a disk Windows can see and still can’t read. Blank is not dead. Letters are echo list volume | diskpart. The little recovery and EFI rows normally have none. Don’t format from either screen if you think the files are still on it.
If diskpart says access denied, you aren’t admin. wmic saying it isn’t recognized is a different message, and it is not a cue to install anything. If you want the PowerShell version:
- Get-Disk | Format-Table Number, FriendlyName, HealthStatus, Size
- Healthy in that column is not a SMART pass. I’ve had Healthy on a disk CrystalDiskInfo already called Caution. Size in this table is bytes, so the number looks huge next to diskpart’s column. That’s not a second disk. The lifespan post is the reading I trust.
- Get-PhysicalDisk | Format-Table FriendlyName, MediaType, HealthStatus, OperationalStatus
- Same caveat. Healthy is not a SMART pass.
Linux, from the live desktop, once, so I don’t guess the device name:
- lsblk -o NAME,SIZE,MODEL,TRAN,MOUNTPOINT
- TRAN says how it is attached. nvme, sata, or ata are internal. ata is an older controller, still the internal disk. usb is every USB disk, including the stick you booted. Don’t run the next command at the usb row.
- No row for the internal stick means this boot didn’t get it. If BIOS shows the model name, don’t buy a board. If the name isn’t in BIOS either, seating and slot, same NVMe guide. A command will not create a socket.
Is it dying, without “fixing” it
Command Prompt has no SMART reading I trust. wmic diskdrive get status sits on OK right up until the day it doesn’t, and then it’s late. I open CrystalDiskInfo. Same tool as the lifespan post. Caution or Bad means stop and copy.
From the Linux USB, smartmontools is the one that actually reads it. The package is not on every live image. If the command is missing I don’t go install it. On a try-desktop that install sits in RAM and disappears at reboot anyway. I boot an image that has it, or I use CrystalDiskInfo from a Windows box and a USB enclosure.
- sudo smartctl -H /dev/nvme0
- sudo smartctl -a /dev/nvme0
- lsblk prints nvme0n1. smartctl wants the controller, /dev/nvme0. If the row is nvme1n1, that’s /dev/nvme1. Don’t add p1. That’s a partition.
- Match the row. A SATA disk is the one whose TRAN says sata or ata, not whichever letter a forum post used. The live USB is the usb row, and on an NVMe-only machine that stick is often sda.
- smartctl -H saying PASSED is one warning bit. It is not the all-clear in the lifespan post. smartctl -a is the reading I look at. No percent cutoff.
- I/O errors in sudo dmesg while that runs means I stop. Copy what’s still readable. The clone guide names ddrescue for that, and the image has to land on a different disk. I don’t paste a dd line in here. One wrong device name wipes the wrong drive.
chkdsk with no switches is a read-only look at the file-system records. It doesn’t fix anything. chkdsk /r is the long grind, and it implies a fix pass. I don’t run either one when the disk already hesitates. fsck on Linux is the same urge. File-system checks are for a dirty shutdown on a disk that still passes SMART. Not for a disk that’s vanishing.
The battery number, and what it doesn’t mean
Admin Command Prompt, not PowerShell. In PowerShell that %userprofile% does not expand. I send the file to the desktop because an admin Command Prompt starts in System32, and people never find the report that landed there.
- powercfg /batteryreport /output "%userprofile%\Desktop\battery-report.html"
- Open that file. Design capacity is what it shipped with. Full charge capacity is what it holds now. I look harder when full charge is a lot lower than design. I still look at the pack before I buy one.
- A pillow, a lifted trackpad, a cover that won’t sit down: stop. That’s Swollen laptop battery: stop using it, then replace it. The report is not the test for that.
- A desktop will run the command and tell you there’s no battery. That’s not a fault.
Linux can do the same job with upower -e and then upower -i on the BAT device it prints. Compare energy-full to energy-full-design. Some packs say charge-full and charge-full-design instead. Same comparison. Ignore the line that just says capacity. That’s a percent of the current full charge, not of the design number. A lot of live USBs don’t have upower running. I don’t fight that. The Windows report is the one I use when the laptop still boots.
Temps and RAM, the commands that aren’t
There isn’t a Command Prompt temperature I will bet a paste job on. The old WMI thermal-zone number is the wrong unit on a good day, and on a laptop it often isn’t the CPU. If it’s hot, that’s Laptop running hot: vents, fan, then paste. BIOS, or a tool that names the sensor. Not a command I found in a list.
mdsched.exe reboots into Windows Memory Diagnostic. One pass is a hint. It is not the overnight test. If it finds something, or the crashes keep coming and the disk is clean, I go to How to tell RAM is failing before you buy more of it and boot MemTest86. I don’t add a stick because Task Manager said 8GB.
When the disk is fine and Windows isn’t
Only after SMART is boring and the machine still boots. Admin prompt. DISM first, then sfc. sfc copies replacement files out of the local store, so a rotten store makes sfc shrug. DISM repairs that store. Then sfc again, otherwise the shrug is the last word.
- DISM /Online /Cleanup-Image /ScanHealth only looks. RestoreHealth is the fix.
- DISM /Online /Cleanup-Image /RestoreHealth
- sfc /scannow
- DISM wants the network up so it can pull clean files. No Wi-Fi, it often just fails. That’s not a dead SSD.
- Neither command puts a drive back into BIOS. If the model name was never on the storage page, you’re in the NVMe guide.
When the internet is the sick part
Admin prompt. The PC boots, and the browser can’t find sites.
- ipconfig /flushdns clears the DNS cache. Safe.
- netsh winsock reset, then reboot. A VPN app may need reinstalling after.
- netsh int ip reset, then reboot.
- Neither one fixes a dead Wi-Fi card.
Every command built into Command Prompt
These are inside cmd.exe. They are not separate programs. The tables plus del and rd in the danger box are the whole built-in set. cd and chdir are one command. del and erase are one command. Microsoft’s longer command index also lists Server tools, and words that only work after you are already inside diskpart. I left those out. clean typed at C:\ is not a command. clean inside diskpart is, and that one is in the danger box.
| Command | What it’s for |
|---|---|
| dir | Lists the folder you’re in. |
| cd, chdir | Changes folder. cd /d E: changes the drive too. |
| cls | Clears the window. Nothing on the disk. |
| type | Prints a text file. Don’t point it at a giant binary and expect a story. |
| ver | The Windows version string. Thin, but it’s the real one. |
| vol | The label on a drive letter. |
| echo | Prints a line. In a batch file, echo off hides the commands as they run. |
| title | Renames the window. |
| color | Window colors. color with nothing after it puts them back. |
| prompt | Changes the text at the start of each line. |
| exit | Closes the window. |
| path | Typed alone, shows where Windows looks for programs. Don’t set it to empty. |
| set | Typed alone, prints variables. set PATH= with nothing after the equals blanks that search list. |
| verify | Old command for whether copy double-checks. I leave it. |
| Command | What it changes |
|---|---|
| copy | Copies a file. If that name already exists, it can overwrite it. |
| move | Moves a file. Same overwrite problem. |
| ren, rename | A new name. Two files in one folder can’t share it. |
| md, mkdir | Makes a folder. |
| mklink | Makes a link the file system treats as real. I don’t make one to fake a missing file. |
| assoc | Which program opens an extension. A wrong one opens your files in the wrong app. |
| ftype | The open command for that file type. The other half of assoc. |
| date | Shows the date. Setting a wrong one breaks sites and updates until the clock is right. |
| time | Same for the clock. I don’t set it to test a theory. |
| pushd | Goes to a folder and remembers the old one. |
| popd | Goes back to what pushd remembered. |
| start | Opens a program or a folder in another window. |
| Command | The rest of the built-in set |
|---|---|
| break | An old Ctrl+C toggle. On a current Windows box it doesn’t change the job. |
| call | Runs a batch file and comes back. |
| for | A loop. I don’t paste one. for pointed at del is how a short script deletes more than the one file. |
| goto | Jumps to a label inside a batch file. |
| if | A test inside a batch file. |
| rem | A comment. The computer skips the line. |
| shift | Slides the batch file’s arguments along. |
| setlocal | Keeps a batch file’s variables inside that file. |
| endlocal | Ends setlocal. |
| pause | Waits until you press a key. |
External commands that are on a home PC
These are separate programs, usually in System32. help prints some of them and skips others. ping is one it skips. This is still not every file in that folder, and it is not the Server list. Domain tools, old backup programs, and commands Windows only adds if you turn a feature on are not here. If the window says it isn’t recognized, the program isn’t on this PC. Don’t go install a pile of optional features to complete the list.
| Command | What I use it for |
|---|---|
| ipconfig | Is the adapter listed, and did it get an address. |
| ping | Does one address answer. ping 127.0.0.1 only proves Windows answered itself. |
| tracert, pathping | The route to an address. Not a dead-disk test. |
| netstat | Connections this PC has open. Not a parts test. |
| systeminfo | OS, RAM amount, BIOS date. It’s slow. |
| driverquery | A long driver list. A long list is not a diagnosis. |
| tasklist | What’s running. |
| taskkill | Stops one process. The wrong one just closes a program. It does not fix a disk. |
| whoami | Which account this window is. A standard user can’t read some folders and calls it a missing disk. |
| hostname | The PC’s name. |
| where | Which file Windows would run for a command name. |
| msinfo32 | Opens the System Information window. |
| getmac | The adapter’s MAC address. I rarely need it. |
| sfc | Repairs Windows files. Already covered. After DISM, and only if the disk is healthy. |
| DISM | Repairs the store sfc copies from. Wants the network. Doesn’t put a drive in BIOS. |
| powercfg | The battery report. Already covered. |
| chkdsk | No switches is a look at the file-system records. /r is in the danger box. |
| chkntfs | Whether Windows will check the disk at the next boot. I don’t tell it to skip one. |
| diskpart | list disk and list volume are the safe lines. clean is not. It’s in the box. |
| robocopy | Copies a folder that still opens. Set the retry count low. The default will sit there forever on a dying file. |
| xcopy | The older copy. I use robocopy. |
| tree | A picture of the folders. |
| find, findstr | Search text. |
| fc | Compare two files. |
| comp | An older compare. |
| more | Pages a long printout. |
| clip | Puts the command’s output on the clipboard. |
| sort | Sorts lines of text. |
| attrib | Hidden and read-only flags. I don’t clear system flags on a Windows folder. |
| compact | NTFS compression. I don’t turn it on to make room on a disk that’s already sick. |
| label | Renames the volume. I don’t, while I’m still trying to tell disks apart. |
| subst | Maps a folder to a drive letter. Handy, and also a good way to forget which disk you meant. |
| mountvol | Shows mount points. I don’t delete one to tidy up. |
| net | A family. net user, net share, and more. I don’t make an account off a screenshot. |
| sc | sc query shows a service. sc delete removes one. I don’t delete a service because a post called it leftover. |
| schtasks | Scheduled tasks. I don’t delete them from a list I don’t recognize. |
| shutdown | shutdown /s turns off. shutdown /r reboots. shutdown /r /o reboots into Advanced Startup: Startup Repair, Safe Mode, System Restore. That's all I use it for. |
| gpresult | Which policies applied. On a home PC that isn’t in a domain, it’s usually a short nothing. |
| choice, timeout, doskey, mode | Batch menus, a wait, command history, and console settings. Not a hardware test. |
| cmd | Opens another Command Prompt. |
| help | Prints a mixed list, built-ins plus a lot of these programs. It is not the whole of either list. help dir still prints the switches. |
| wmic | Often missing on newer Windows 11. I don’t install it. The PowerShell line is Get-Disk, above. |
Linux commands on a live USB
No command prints every Linux program. These are the ones on a normal live desktop that answer the same questions as the Windows list. cp and mv copy and move, and they overwrite a file that already has the name. They are not how I clone a dying disk. sudo runs the next word as root. sudo is not the dangerous part. The next word is.
| Command | What it’s for |
|---|---|
| uname -a | Kernel name. Tells me the USB actually booted. |
| cat /etc/os-release | Which distro this live desktop is. |
| pwd | The folder I’m in. |
| ls | Lists a folder. The Linux dir. |
| cd | Changes folder. |
| cat | Prints a text file. |
| less | Same, one page at a time. |
| df -h | Free space on what is mounted. |
| du -h | How big a folder is. |
| free -h | RAM the system can see. |
| lsblk | Disks, and whether each one is nvme, sata, ata, or usb. Already covered. |
| blkid | Filesystem type. A look. I don’t pass it a switch I found in a post. |
| findmnt | What is mounted, and where. |
| mount | With no extra words, the same kind of look. I don’t give it a device and a folder off a screenshot. |
| dmesg | Kernel messages. I/O errors here mean I stop and copy. |
| lspci | Devices on the PCI bus. |
| lsusb | USB devices the kernel sees. |
| lscpu | The CPU. |
| ip link | Adapters, up or down. |
| ip addr | Addresses. The Linux ipconfig. |
| ping | Does one address answer. |
| ps | What’s running. |
| smartctl | The SMART read. Already covered. Match the device to the lsblk row. |
| upower | Battery full against design, when the live image has it. |
If Windows never gives you a prompt
Then every Windows line above is useless. I boot a live Linux USB, pick the option that tries the system, and run lsblk. I do not click Install. Install onto the internal disk is how the files you were trying to read get replaced. The USB is the tool. The sick disk stays a disk I only read.
What I'd use
A 32GB USB 3 stick for a live Linux session
This is how I run lsblk and smartctl when Windows won’t open. 32GB is enough for a live image. The brand matters less than not installing that image onto the drive you’re diagnosing.
- Use the distro’s own writing instructions. Rufus and balenaEtcher both work if you pick the live image and not your internal disk.
- Unplug extra drives before you write the USB if you tend to click the wrong target.
What I'd use
USB enclosure for NVMe/SATA
This is how I read a stick the motherboard won’t show. A SATA-only board will not see an NVMe stick. Some enclosures do both. Match the drive you pulled.
- If it doesn’t say NVMe or PCIe, treat it as SATA-only.
What I'd use
External drive to copy to
The copy has to land on a different disk. A 1TB external is the bucket. It is not the repair.
- If the sick disk already clicks, stop. The clone guide is the copy. A normal copy hangs on the bad file.
Verdict
List the disk. Read SMART. Don’t chkdsk a drive that’s already dying. Battery report for a worn pack, eyes for a swollen one. DISM, then sfc, only after the disk looks fine. Anything with clean, format, or of= stays untyped.