[2021] How to Repair Windows 11/10 From Command Prompt?

menu_default hide_default

Many people got problems with their computers, such as hard drive errors, corrupted files, missing files, Windows update errors, and Windows startup issues. Some people even complained about getting crashed after upgrading to Windows 11/10.

If you are facing the problems above, we got you covered. This guide goes over how to repair Windows 11/10 using Command Prompt.

How Do I Repair Windows 11/10 From Command Prompt?

Most of us don't like the Command Prompt interface where we have to type commands one by one at a time, wait for the response, and then adapt our next move. However, the Command Prompt comes in handy when we're locked out or can't get windows to boot into normal mode.

Windows 11/10 is not completely stable, and there is still a possibility of encountering various errors. In common situation, we can deal with the issues by Command Prompt. Therefore, it is highly recommended to give Command Prompt a try. Here we provide 5 solutions to repair Windows 11/10 from Command Prompt.

1. Scan and Repair Your Hard Drive Using CHKDSK

Disc scan repair, commonly known as CHKDSK, is a vital tool for monitoring your disk drive health with windows. This tool can be used primarily for speeding up your Windows operating system and repair your hard drive. It's recommended to do this every few months.

Step 1 Go to search and look for Windows PowerShell. Right-click and Run as administrator.
(Windows PowerShell is the same as Command Prompt. It just allows more features and extensive programs to run.)

Step 2 You'll be asked for permission to launch the Windows Common Processer on the next screen.

Step 3 Next, type chkdsk f: /f /x /r to dismount it. Then, scan it for errors, and finally repair it. (f: means drive f, replace it according to your own situation)

Step 4 You might run into an issue that the drive is currently in use by the current operating system. To combat this, you can reboot into recovery mode.

Perform A Disc Scan Repair For Hard Drives on Windows

2. Repair Windows 11/10 Missing or Damaged Files Using SFC

Damaged and missing files happen from time to time. Luckily, the Command Prompt can help us out by scanning our entire system and doing an in-depth analysis of what needs repairing.

You might have asked: How do I run a system repair from a Command Prompt? SFC is the most common method.

Step 1 Choose a drive where to store the system image files. It's highly recommended to use a separate hard disk for this.

Step 2 Run the Command Prompt as Administrator and type in sfc /scannow to analyze system files, followed by sfc /scanonce to scan the one-time auto-fixing file. This will take some time, but it should fix all corrupted or missing system files.

Download and install Windows 10/11  from the Microsoft website

3. Repair Windows 11/10 Update Error Using DISM

Sometimes, corruption errors occur, and windows service updates can fail. If a system file is damaged, that can also cause the package not to install correctly. The DISM Is a solution to help fix Windows corruption errors.

Step 1 To start, download DISM from the Microsoft website.

Step 2 Type Command Prompt or cmd in search bar. Then, make sure you right-click and select Run as administrator.

Step 3 Enter this command: Dism /Online /Cleanup-image /Restorehealth

Running this command, DISM will use the Windows Update tool to fix the corrupt files.

Repair Windows 11/10 Update Error Using DISM

However, if your Windows Update client is corrupted, you can use the Windows Installation as a repair tool via the Windows disc. If you're doing this, you can run this command:

DISM.exe /Online /Cleanup-Image /RestoreHealth /Source:C:\RepairSource\Windows /LimitAccess

Repair Windows 11/10 Update Error Using DISM2

Step 4 Now, you can type sfc /scannow and hit Enter. After several minutes it should be completed.

Step 5 Close the Command Prompt and try rerunning the Windows Update client.

4. Reset Windows 11/10 Boot With Command Prompt

Try this out if you're having problems getting Windows to boot up properly. Using this Windows 11/10 startup repair command, we can get your system to boot into safe mood and go from there.

Step 1 Go to your search bar on your computer and type in Command Prompt or cmd. Then, Right-click and click Run as administrator.

Step 2 Now, type in bcdedit /deletevalue {current} safeboot and hit Enter.

Reset Windows 11/10 Boot With Command Prompt

Step 3Restart your computer by typing shutdown /r /f

This will restart your computer into normal mode, and you can now access Windows easily!

5. How To Activate Windows 11/10 With Command Line

Here's precisely how you can activate Windows 11/10 from the Command Prompt.

Step 1 Open a Command Prompt window by pressing Windows key + R and typing cmd in the box that appears, then press Enter.

Step 2 Type slmgr/xpr and press Enter. The Command Prompt will display the License Status for your Windows installation.

Activate Windows 11/10 With Command Line

Step 3 If there's an error message, type slui 3 in search bar and press Enter. This will bring up a System Activation Wizard that will automatically diagnose your issue and prompt you to take appropriate action.

Step 4 Clear the Activation text box and type in Windows Product Key, and press Enter.

Step 5 Press any key when you're prompted to restart.

Step 6 After the computer restarts, you will be back in the Command Prompt window. You should see a message that reads, "Windows is activated with a digital license. " This means your Windows installation has been activated successfully.

Note

If this method doesn't work for you, try the following commands one by one in CMD and check if activation takes place. You can also use these commands from a batch file or via some other script method.
slmgr /ipk YourWindowsProductKey
slmgr /skms YourWindowsProductKey
slmgr /ato
slmgr/dli* - direct license install -e

FAQ About Windows Command Prompt

1. How Do I Clear the Command Prompt in Windows 11/10?

  • Method 1: Once in the Command Prompt, type in cls. Then press Enter. This will clear the entire application screen for you.

  • Method 2: Press the ESC key to clear the text line and move back into the Command Prompt.

2. How Do I Delete a File or Folder in CMD?

Using the proper commands will allow you to delete anything from files or folders across SD Cards, hard drives, etc. Here's how:

  • Delete a Folder: Start the Command Prompt by typing in CMD in the start menu.
    Now, you can type in the command line: Rmdir "C:\Users\Username\Documents\MyFolder".
    Then press Enter to execute it. This will promptly delete the folder. (Replace the MyFolder above with the specific location of your folder)

  • Delete a File: To delete a specific file forcefully, you need to use Del instead of Rmdir.
    For example: Del "C:\Users\Username\Documents\MyFile". (Replace the MyFile with the specific location of your file)

3. How To Enable Telnet Client in Windows 11/10 using CMD?

This can be achieved very easily with CMD. Start by holding down the Windows Key, then press R. A dialog will appear where you can type in the following: pkgmgr /iu: "TelnetClient ". Then, you need to select OK, and from there, Windows will install the client.

How to Recover Data From A Hard Drive That Won't Boot?

When your hard drive refuses to boot, the entire content is in danger. If the common methods can't work for you, you need to use profesional data recovery tool to rescue your data. Click for a detailed guide about recover data from a hard drive that won't boot.

AnyRecover is clearly the best option for doing this, which gives us many options like deep scanning over multiple drives, recovering various data, and more. AnyRecover makes data recovery cost-effective and straightforward. Start your free trial to make sure it can really work for you before purchasing. You can recover 8 files for free without any size limit.

AnyRecover deleted file recovery tool

2,061,704 Downloads

Features of AnyRecover

  • Ensuring a high success rate with super user-friendly interface, the process of recovery only need 3 simple steps.

  • Over 1000+ file types are supported, including but not limited to Video, pictures, documents, archives, etc.

  • Retrieve permanently deleted files from various devices like computer hard drive, external drive, USB flash drive, SD card, SSD, camera, etc.

  • Merely scan your hard drive for the deleted data. It won't change or damage your files or devices.

Download NowDownload Now

Wrap-up

What's beautiful with Windows is that many of our everyday problems can be cleverly solved using Command Prompt. You have to know what commands to enter to fix your problem. Luckily, the Command Prompt allows us to control many aspects of the operating system by simply entering in the correct commands. You will be steps ahead of the game if you learn and master some of the fundamental navigational commands. However, if your hard drive can't even boot, try to use the professional data recovery tool AnyRecover to rescue your data.

user

By Greyson Cyrus , to Windows Tips

Updated: Aug 18, 2021