How To Factory Reset Windows From Command Prompt in 2026?
A factory reset reinstalls Windows and removes installed applications, drivers, and system changes. Depending on the option you choose, it may also delete personal files. This process is commonly used to fix severe system errors, malware infections, boot failures, or performance issues that cannot be resolved through normal troubleshooting.
Note: You should back up important files if possible. If Windows does not boot at all, you may need to rely on cloud backups or external storage created earlier. Also, ensure that your laptop or desktop is connected to a reliable power source to avoid interruption during the reset.
If you are also struggling with any of these issues, resetting your PC with the right command prompt is one of the best options.
In this guide, you will learn how to factory reset Windows from the Command Prompt in an easy way.
So let’s know the steps and the right command prompt that can wipe your computer!
How To Factory Reset Windows From Command Prompt?

To factory reset Windows from Command Prompt, you need to access the Windows Recovery Environment, open Command Prompt, and run the system reset command (systemreset -factoryreset) that launches the built-in Windows reset tool. This process allows you to reinstall Windows while optionally keeping or removing your personal files, even if the desktop interface is not accessible.
The detailed steps are given below!
Step 1: Boot Into Windows Recovery Environment
The first step is accessing the Windows Recovery Environment, commonly known as WinRE. This environment provides advanced repair and recovery options, including Command Prompt.
If your system is bootable, restart your computer and repeatedly interrupt the boot process by holding the power button as Windows starts loading. After two or three failed starts, Windows automatically enters the recovery screen. If Windows still loads normally, you can hold the Shift key and click Restart from the power menu to force entry into recovery mode.
Once the recovery screen appears, select the option labeled Troubleshoot. This section contains tools designed for system repair and reset.
Step 2: Open Command Prompt From Advanced Options
After selecting Troubleshoot, navigate to Advanced options. This menu contains several utilities such as Startup Repair, System Restore, and Command Prompt.
Choose Command Prompt. Your computer may ask you to select a user account and enter its password. This step is required to ensure authorized access to system-level commands.
When Command Prompt opens, you will see a black window where you can type system commands. This environment runs with administrative privileges, which is necessary to initiate a factory reset.
Step 3: Verify Windows Drive Letter
In the recovery environment, the Windows installation may not always use the usual C drive letter. Verifying the correct drive helps avoid errors.
Type the command diskpart and press Enter. Then type list volume to view all available drives and partitions. Look for the volume that contains the Windows folder. It is usually labeled with a familiar size and file system.
Once you identify the correct drive, type exit to leave DiskPart. This step ensures that the reset command targets the correct Windows installation.
Step 4: Run the System Reset Command
Now you are ready to start the factory reset process using Command Prompt. Once Command Prompt is open in the Windows Recovery Environment, you can directly launch the built-in Windows factory reset tool using a system command. This command works for both Windows 10 and Windows 11 and does not require the desktop to load.
In the Command Prompt window, type the following command carefully and then press Enter.
systemreset -factoryreset
After running this command, Command Prompt will briefly process the request and then open the Reset this PC window automatically. This confirms that the command has been executed successfully.
If the reset window does not appear immediately, wait a few seconds. In some systems, the interface may take a short time to load, especially on older hardware.
Once the Reset this PC screen appears, you will be prompted to choose how you want to reset Windows. From here, the reset process continues using the standard Windows recovery interface, even though it was initiated through Command Prompt.
This command is especially useful when Windows fails to boot normally, system settings are inaccessible, or the graphical reset option does not open.
Step 5: Choose the Reset Option Carefully
You will see two main options during the reset process. One option allows you to keep personal files while removing apps and settings. The other option removes everything, including files, apps, and user accounts.
If your goal is to fix system issues while preserving documents and photos, choose the option to keep files. If you are selling the device or dealing with serious malware, removing everything is the safer choice.
Windows may also ask whether you want to reinstall the operating system using local files or a cloud download. Cloud download fetches a fresh copy of Windows, which is helpful if system files are damaged. Local reinstall uses existing files stored on your device.
Step 6: Confirm and Start the Factory Reset
Once you make your selections, Windows will display a summary of what will happen during the reset. Review this information carefully. It lists which files will be removed, which settings will be reset, and whether user accounts will be deleted.
Confirm the reset to begin the process. Your computer will restart multiple times while Windows reinstalls itself. This can take anywhere from thirty minutes to several hours, depending on system speed and the reset option chosen.
Do not turn off the device during this stage, as interruption can cause further system damage.
Step 7: Complete Initial Windows Setup
After the reset is complete, Windows will boot into the initial setup screen. This is the same experience you see when starting a new computer. You will need to select your region, keyboard layout, and network connection.
Sign in with a Microsoft account or create a local account, depending on your preference. Once setup is complete, Windows will load a fresh desktop environment. At this point, the factory reset using Command Prompt is successfully finished.
Faqs
Can I factory reset Windows using Command Prompt without logging in?
Yes, you can access Command Prompt through the Windows Recovery Environment without logging into the desktop. However, you may still need to authenticate with a user account password for security reasons.
Does factory resetting Windows from the Command Prompt delete all data?
It depends on the reset option you choose. You can keep personal files or remove everything. Always assume data loss is possible and back up important files beforehand.
Is this method safe for Windows 10 and Windows 11?
Yes, this method works for both Windows 10 and Windows 11, as both use the same recovery environment and reset mechanism.
What if the reset command does not work?
If the reset tool fails to launch, system files may be severely corrupted. In such cases, using a bootable Windows installation media may be required to reinstall the operating system manually.
How long does a factory reset usually take?
The time varies based on hardware speed and reset type. On average, it can take from thirty minutes to two hours.
