14 Windows Commands That Can Fix Most PC Problems

On
Windows commands for everyday use

There are different types of problems every Windows user has to deal with. These can include booting-related issues, disk corruption, slow computer performance, or network-related errors. An average Windows user isn't tech-savvy and often struggles to fix these issues. Most of these problems can be fixed easily without the need for a computer technician. In this tutorial, we'll learn some of the most useful commands to fix common Windows problems. We'll be using the command prompt interface. Even if you've never used a command line interface (CLI) before, you'll be able to follow this guide.

Windows commands for everyday use
📷 Best Windows Commands to Fix Your PC

You must be an administrator to use most of these commands, as they require elevated privileges to directly interact with the operating system. So make sure you have administrator account access.

Read Also:
Automate Everyday Windows Tasks with Simple PowerShell Scripts

Some of these commands may take a significant time to complete execution. So, be patient and let the command do the magic. Let's get started and learn these essential commands to fix Windows issues.

Open Command Prompt as Administrator

Most of the commands mentioned below require administrator privileges. Therefore, the first step is to open a command prompt window with admin powers. Here's how to do it:

  1. Press the Win + S key combination.
  2. Type cmd in the text box.
  3. Right-click on the Command Prompt option.
  4. Click the Run as Administrator option from the context menu.

The command prompt window is now running with administrator privileges.

1. Scan and Repair Corrupted System Files

First comes the System File Checker (SFC) utility that scans all the protected Windows system files. If any such file is missing or is corrupted, this tool replaces it with its cached version.

sfc /scannow

Ideal Use Cases:

This command should be used to fix:

  • Windows Crashes
  • System Errors
  • Corrupted/Missing DLL Files
  • Unstable System

Note: On average, this command takes anywhere between 15 and 30 minutes to complete execution. On modern systems with a fast SSD, it may finish within 10 minutes.

Remember, it cannot fix system files in every situation. In that case, we have to use other commands for the same.

2. Check and Repair Windows System Image

The DISM (Deployment Image Servicing and Management) tool is a more advanced and powerful option to fix Windows system issues.

You can use it in the following scenarios:

  • When the sfc command fails to resolve the issue.
  • When the error is related to a Windows update.
  • Or, the Windows system image is in a corrupted state.

Quick Check for Windows System Image Health

To perform a quick health check for the Windows system image, use the following command:

DISM /Online /Cleanup-Image /CheckHealth

It quickly checks for any corruption in the Windows system image.

Full Scan for Checking Windows System Image Health

For a comprehensive scan, execute the following command:

DISM /Online /Cleanup-Image /ScanHealth

It may take some time for this command to complete its execution.

Repair the Windows System Image

And finally, to repair the corrupted Windows system image, use the following command:

DISM /Online /Cleanup-Image /RestoreHealth

Make sure your internet connection is active while firing this command.

3. Fix Hard Drive Errors

If you are experiencing a corrupt file system or bad disk sectors, the following command can help you fix both these issues. Here's how to use it.

chkdsk C: /f /r

Here's what each parameter does:

  • /f : Fixes file system errors
  • /r : Finds bad disk sectors
  • /x : If required, dismounts the volume before scanning and fixing.

This command can be used to fix the following errors:

  • If the disk is corrupted.
  • If the system is very slow.
  • Boot-related issues.
  • Damaged file system.

4. Fix Internet Connectivity Issues

Now, let's see a few commands to fix different types of internet issues. It's a single command with different parameters to do a specific job. Let's see them one by one.

Fix DNS Issues

This command clears the local DNS cache, which may be outdated.

ipconfig /flushdns

It may help in resolving the following issues:

  • Websites are failing to load.
  • Errors related to DNS.
  • General internet connectivity problems.

It's a good practice to flush the local DNS cache at least once a month.

Release Currently Assigned IP Address

While connecting to the internet, the DHCP protocol assigns an IP address to your device. To release it, use the following command:

ipconfig /release

And, to get a new one, follow it with this command:

ipconfig /renew

This command instructs the router to grab a new IP address for the device. It resolves the following issues:

  • Any local network conflicts?
  • Issues related to IP address.
  • Router-related errors.

Display Detailed Network Information

Finally, if you want to display detailed network information on your PC, use the following command:

ipconfig /all

It displays the following network configuration information:

  • MAC addresses of all the network devices (physical or virtual)
  • IP addresses assigned to each network device.
  • Information about DNS servers.
  • Current status of the DHCP service.

It's one of the most popular commands to resolve internet connectivity issues.

5. Reset Network Stack

Sometimes, to fix a connectivity issue, all you need to do is reset the TCP/IP stack to its default settings. Here's how to do it:

netsh int ip reset

It fixes the following issues:

  • Issues related to network configuration.
  • General connectivity problems.
  • Network adaptor issue.

Repair Windows Winsock Catalog

Use the following command to do it:

netsh winsock reset

It fixes the following issues:

  • General connectivity problems.
  • Network stack damaged by malware.
  • Errors related to web browsers.

After executing all these commands, make sure to restart the PC.

6. Check Network Connectivity

This handy tool is used on almost all desktop OS to test network connectivity.

ping google.com

Typical use cases of this command are:

  • Test the internet connection.
  • Test the latency of the network.
  • Check for intermittent connection loss.

7. Trace Internet Connection Path

This command shows you the path data packets are taking from your computer to the server you are trying to reach.

tracert google.com

Use the server domain address you are trying to connect to, replacing the Google domain used here as an example. This command helps in diagnosing:

  • Slowdown of the network (latency issues).
  • Routing problems.
  • Delays happening at the server end.

8. Manage Running Processes

Although Windows Task Manager is the first choice of a user for managing processes on a PC, power users often prefer commad-line for the same. Here's how you can do it.

Display Running Processes

tasklist

This command lists all the running processes on your Windows machine. It's very useful for:

Forcefully Terminate Programs/Processes

taskkill /IM firefox.exe /F

This command immediately terminates the target process. It can be used for:

  • Terminating frozen applications.
  • Closing processes hogging the CPU.

9. Get System Information

If you want to see detailed system information of your PC, use the following command:

systeminfo

The listed data includes the following details:

  • Windows version
  • Processor details
  • RAM info
  • BIOS details
  • Network cards details

It is generally used by administrators and technicians while troubleshooting issues.

10. Fix Microsoft Store Problems

The following command clears the Microsoft Store cache.

wsreset.exe

This effectively fixes the following issues:

  • Problem in opening the store.
  • Apps from the store fail to install.
  • Apps update errors.

11. Free Disk Space

To free up disk space on your Windows machine, execute the following command:

cleanmgr

It opens a Disk Cleanup GUI utility that can be used to purge the following:

  • Windows Update leftover files.
  • System logs
  • A huge chunk of temporary files.

12. Diagnose Battery or Power Problems

Struggling with battery and power issues on your Windows PC? Here's a command to get an extensive report on the same to fix and resolve such issues.

powercfg /energy

This command finds out battery issues (if any) and also checks your current power settings.

13. Restart or Shut Down System Instantly

We shut down or restart our PC through the GUI interface every day. You can do that from the command line, too. Here's how you do it:

shutdown /r /t 0

The following parameters can be used with this command:

  • /r : Restart
  • /s : Shutdown
  • /t : Time delay

You can either use this command to remotely shut down or restart a PC on a local network, or you can use this command in your script.

14. The Ultimate Windows Repair Command Sequence

And lastly, if your Windows system isn't stable and is frequently running into issues, use the following command sequence to fix most of the issues.

sfc /scannow
DISM /Online /Cleanup-Image /RestoreHealth
chkdsk C: /f /r
ipconfig /flushdns
netsh winsock reset

Most of the time, you'll never need an IT technician after executing this command sequence.

Conclusion

The Windows Command Prompt is one of the most powerful tools for diagnosing and fixing PC problems. With just a few commands, you can repair corrupted system files, fix network errors, scan hard drives, and optimize performance.

Learning these 14 essential Windows commands can save hours of troubleshooting — and in many cases, help you avoid reinstalling Windows entirely.

Whether you're a power user, IT professional, or everyday PC user, mastering these commands gives you the ability to fix most Windows issues quickly and efficiently.