Advertisement

20 Things You Can Solve with CMD and PowerShell

Most people think you need special software to fix Windows problems. But honestly? Windows comes with two powerful tools built right in - Command Prompt (CMD) and PowerShell. I've fixed more problems with these than I can count, and you don't need to download anything.

Here are 20 real problems you can solve right now, no software needed. Some of these will save you hours of frustration.

1. Find Out What's Using Your Internet

Ever wonder what's eating your bandwidth? Open PowerShell (right-click Start, choose PowerShell) and run:

Get-NetTCPConnection | Group-Object -Property State, OwningProcess | Sort-Object Count -Descending

This shows you which processes are making network connections. If something's using way more than it should, you'll see it here.

2. See What's Actually Running

Task Manager is fine, but sometimes you need more detail. In PowerShell:

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

This shows your top 10 CPU hogs. Useful when your computer's running slow and you can't figure out why.

3. Check Your Disk Space

In CMD, type:

wmic logicaldisk get size,freespace,caption

Shows you exactly how much space you have on each drive. The numbers are in bytes, so divide by a billion to get GB.

4. Find Large Files Taking Up Space

In PowerShell, navigate to a folder and run:

Get-ChildItem -Recurse | Sort-Object Length -Descending | Select-Object -First 20 Name, @{Name="Size(MB)";Expression={[math]::Round($_.Length/1MB,2)}}

This finds the 20 largest files in the current directory and subdirectories. Great for finding what's eating your storage.

5. Flush Your DNS Cache

If websites aren't loading or you're getting weird connection errors, flush your DNS. In CMD (run as admin):

ipconfig /flushdns

This clears your DNS cache. I do this whenever I'm having weird internet issues and it fixes it about half the time.

6. Release and Renew Your IP Address

Network problems? Try this in CMD (run as admin):

  1. ipconfig /release
  2. ipconfig /renew

This forces your computer to get a fresh IP address from your router. Fixes a lot of connection issues.

7. See All Your Network Connections

Want to see everything connected to your network? In CMD:

arp -a

Shows all devices on your local network with their IP and MAC addresses. Useful if you're trying to figure out what's on your Wi-Fi.

8. Test Your Internet Connection

Ping Google's DNS to test your connection:

ping 8.8.8.8 -t

Press Ctrl+C to stop. If you're getting replies, your internet works. If not, the problem is your connection, not your computer.

9. Check Your System Info

In CMD:

systeminfo

Shows everything about your system - Windows version, install date, RAM, processor, everything. Handy when you need to know what you're working with.

10. See What's Starting with Windows

In PowerShell:

Get-CimInstance Win32_StartupCommand | Select-Object Name, Command, Location

Shows all programs that start automatically. If your computer's slow to boot, this is where you'll find the culprits.

Advertisement

11. Find Files by Name

Looking for a file but don't remember where you put it? In PowerShell:

Get-ChildItem -Path C:\ -Recurse -Filter "filename.*" -ErrorAction SilentlyContinue

Replace "filename" with what you're looking for. The ErrorAction part stops it from complaining about folders you can't access.

12. Check Your Battery Health

On a laptop, in PowerShell:

powercfg /batteryreport

Creates a battery report HTML file. Shows you your battery's health, capacity, and usage history. The file saves to your user folder.

13. See Your Wi-Fi Passwords

Forgot your Wi-Fi password? In CMD (run as admin):

netsh wlan show profile name="WiFiName" key=clear

Replace "WiFiName" with your network name. The password shows up in the "Key Content" field. Useful when you need to connect a new device.

14. List All Wi-Fi Networks You've Connected To

In CMD:

netsh wlan show profiles

Shows all Wi-Fi networks you've ever connected to on this computer. Good for cleaning up old networks you don't use anymore.

15. Check Disk Health

In PowerShell (run as admin):

Get-PhysicalDisk | Get-StorageReliabilityCounter | Select-Object DeviceID, Temperature, Wear, ReadErrorsTotal, WriteErrorsTotal

Shows your disk's health metrics. High error counts or temperature means your drive might be failing. Backup your data if you see problems.

16. See What Ports Are in Use

In PowerShell:

Get-NetTCPConnection | Select-Object LocalAddress, LocalPort, State, OwningProcess | Sort-Object LocalPort

Shows all ports that are being used and by which process. Useful if you're having trouble with a specific program or service.

17. Check Windows Update History

In PowerShell:

Get-WinEvent -LogName System | Where-Object {$_.ProviderName -eq "Microsoft-Windows-WindowsUpdateClient"} | Select-Object -First 20 TimeCreated, Message

Shows recent Windows Update activity. Helpful if you're troubleshooting update problems.

18. See Your Computer's Uptime

In PowerShell:

(Get-Date) - (Get-CimInstance Win32_OperatingSystem).LastBootUpTime

Shows how long your computer's been running since the last restart. If it's been weeks, maybe restart it.

19. Find Duplicate Files

In PowerShell, navigate to a folder and run:

Get-ChildItem -Recurse | Get-FileHash | Group-Object Hash | Where-Object {$_.Count -gt 1} | ForEach-Object {$_.Group | Select-Object Path}

Finds duplicate files by comparing their hashes. Great for cleaning up storage.

20. Check Your System's Memory Usage

In PowerShell:

Get-Counter '\Memory\Available MBytes'

Shows how much RAM is available. If this number is really low, that's why your computer's slow. Close some programs or restart.

Pro Tip: Most of these commands work better if you run CMD or PowerShell as administrator. Right-click the Start button, choose "Windows PowerShell (Admin)" or "Command Prompt (Admin)".

Common Mistakes to Avoid

  • Not running as admin: Some commands need admin rights. If something doesn't work, try running as administrator.
  • Typos in commands: These commands are case-sensitive sometimes. Copy them exactly.
  • Running commands you don't understand: Don't just copy random commands from the internet. Understand what they do first.

Common Questions

What's the difference between CMD and PowerShell?

PowerShell is more powerful and modern. It can do everything CMD can do, plus a lot more. But CMD is simpler for basic tasks. I use PowerShell for most things, but CMD works fine for simple stuff.

Are these commands safe?

Yes, all the commands I listed here are safe. They're just reading information or doing basic Windows maintenance. But be careful with commands you find elsewhere - some can delete files or change important settings.

Do I need to know programming to use these?

Not at all. Just copy and paste the commands. Once you get comfortable, you can start modifying them for your needs.

Try These Commands Today

Don't wait until you have a problem - try a few of these commands now to get familiar with them. Start with the simple ones like checking disk space or system info. Once you're comfortable, you'll find yourself using these all the time.

Advertisement