How to Use PowerShell and Command Prompt to Diagnose Windows 10 and Windows 11 Problems

Use Command Prompt for quick repairs and PowerShell for deeper clues. Windows 10 and 11 include both, and Microsoft still documents repair tools like SFC and DISM for fixing system files [source: Microsoft].

TLDR: Start with sfc /scannow, then use DISM if Windows still acts weird. For internet trouble, test ipconfig, ping, and tracert. For example, if your laptop usually boots in 25 seconds but now takes 90, check startup apps, system files, and recent errors. PowerShell is best when you want clean lists, logs, and details without clicking through 12 menus.

First, open the right tool

You have two main choices.

  • Command Prompt is great for classic repair commands.
  • PowerShell is better for reports, logs, and system details.

To open either one, press Start, type cmd or PowerShell, then pick Run as administrator. Yes, that extra admin click is annoying. Skip it, and half the useful commands complain like a tired printer.

windows PowerShell Commands for remove yourphone.exe

Fix broken Windows files

If Windows crashes, freezes, or throws odd errors, check system files first. This is the “is Windows itself broken?” test.

sfc /scannow

Let it finish. It may take 5 to 20 minutes. If it says it fixed files, restart the PC.

If SFC fails or says it found problems but could not fix them, run DISM next:

DISM /Online /Cleanup-Image /RestoreHealth

Then run SFC again:

sfc /scannow

This one-two punch fixes many slow, glitchy Windows installs. It is boring. It works. That is the charm.

Check the disk for trouble

Apps crashing? Files vanishing? Windows taking forever to load? The drive may be having a bad day.

chkdsk C: /scan

This checks your C drive while Windows runs. If it finds bigger issues, Windows may ask to scan on restart.

For a stronger check, use:

chkdsk C: /f

You may need to reboot. Expect to waste time on this if the drive is large. Still, it is better than ignoring early drive problems until your photos become digital confetti.

Fix internet problems without guessing

When Wi-Fi says “connected” but webpages laugh at you, start simple.

ipconfig

Look for your active adapter. Check if it has an IP address. If it starts with 169.254, your PC did not get a good address from the router.

Try this reset:

ipconfig /release
ipconfig /renew
ipconfig /flushdns

Now test a public server:

ping 8.8.8.8

If that works, test a website name:

ping google.com

If the number works but the name fails, DNS is the suspect.

To see where the connection gets stuck, run:

tracert google.com

This shows each stop between your PC and the site. If it dies at your router, the issue is local. If it dies later, your provider may be the problem.

Use PowerShell to see what Windows is doing

PowerShell shines when you need clear lists. Start with basic system info:

Get-ComputerInfo

This shows Windows version, build number, memory, BIOS info, and more. It is a lot. Use it when support asks, “What version are you on?” and you do not want to dig through Settings.

To check running processes, use:

Get-Process | Sort-Object CPU -Descending | Select-Object -First 10

This lists the top CPU users. If one app is eating the machine, it often appears here.

For memory hogs, try:

Get-Process | Sort-Object WorkingSet -Descending | Select-Object -First 10

Honestly, it feels like some apps treat RAM like an all-you-can-eat buffet. This command names names.

Read error logs without losing your mind

Event Viewer is useful, but it can feel like a junk drawer with 9,000 warnings. PowerShell can cut through it.

Get-WinEvent -LogName System -MaxEvents 20 | 
Select-Object TimeCreated, LevelDisplayName, ProviderName, Message

This shows the last 20 system events. Look for errors around the time your problem happened.

For app crashes, use:

Get-WinEvent -LogName Application -MaxEvents 20 | 
Select-Object TimeCreated, LevelDisplayName, ProviderName, Message

Do not panic over every warning. Windows logs plenty of harmless noise. Focus on repeated errors, crashes, disk warnings, and driver failures.

Check battery health on laptops

If your laptop dies at 32%, ask Windows for a battery report.

powercfg /batteryreport

Windows saves an HTML report and shows the file path. Open it in your browser. Compare Design Capacity with Full Charge Capacity. If full charge is far lower, the battery is worn.

Use these commands as a simple rescue order

  1. Restart first. Yes, really. It fixes more than it should.
  2. Run sfc /scannow.
  3. Run DISM /Online /Cleanup-Image /RestoreHealth.
  4. Check the disk with chkdsk C: /scan.
  5. Test the network with ping and ipconfig.
  6. Use PowerShell logs if the problem keeps coming back.

Save a report before asking for help

You can send command output to a text file. This is handy for tech support or your future self.

ipconfig /all > C:\Users\Public\network.txt

In PowerShell, try:

Get-ComputerInfo | Out-File C:\Users\Public\pcinfo.txt

Now you have proof. Not vibes. Not “it was slow yesterday.” Real data.

Final tip

Do not run random repair commands from strange forums. Stick to known Windows tools first. Command Prompt gives you fast tests. PowerShell gives you better clues. Together, they turn Windows troubleshooting from a guessing game into a short detective story, with fewer headaches and fewer angry clicks.