How To Factory Reset Windows From Command Prompt

Sometimes when your system experiences some issues, the only viable option at hand could be performing a factory reset.

In general, you can reset your PC using the utility tool through the GUI. However, if you are using Windows Recovery Environment, accessing the command prompt may be a more convenient or only option.

But can you factory reset your PC only with Command Prompt?

Factory Reset With Command Prompt

How To Factory Reset Windows From Command Prompt

Performing a factory reset restores your PC to default configuration. It wipes all the applications and other data from your system. After the reset, it will reinstall Windows OS and any programs installed by the PC manufacturer. 

Here’s how you can factory reset your PC with the Command Prompt:

If you can’t log in, start/restart your PC. Press and hold the Power button until it shuts off.

Do this three times, and the next boot will load Windows Recovery Environment.


Now, go through Advanced Options > Troubleshoot > Command Prompt


Type cd C:\windows\system32 and press Enter.

If you can log in, press Windows + R and type cmd. Then press Ctrl + Shift + Enter to launch Command Prompt as administrator cmd.

Type systemreset -factoryreset on the Command Prompt and press Enter.


You’ll get a choice to keep your files or remove everything.

If you select Keep my files , it will preserve everything inside C:\Users\<current user>. where,<current user> = your username.

Whereas, if you choose Remove everything, the system will delete everything even your personal files.


Both options will still remove any installed applications.

If you choose to Remove everything, your system displays this menu.


You can recover deleted contents if you choose Just remove my files. However, if Remove files and clean the drive is choosen, deleted contents can be harder to recover. We recommand you choose the latter option if you have any system issues.

Before resetting, do a final check of all the apps that will be removed by clicking the given option.

Finally, click Reset to initiate the factory reset.

Clean PC With Command Prompt

Another way to completely reset your PC is to perform a Fresh start. This method goes one step beyond factory restore and removes even the preinstalled applications. The Microsoft store apps are still reinstalled, though.

Follow the steps below to perform a fresh start:

Run Command Prompt as an administrator.


Type cd C:\Windows\system32 and press Enter to go to this directory.

Enter the systemreset -cleanpc command.

Click on Next to start the process. 


Mohamed SAKHRI
Mohamed SAKHRI

I'm the creator and editor-in-chief of Tech To Geek. Through this little blog, I share with you my passion for technology. I specialize in various operating systems such as Windows, Linux, macOS, and Android, focusing on providing practical and valuable guides.

Articles: 1273

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Leave a Reply

Your email address will not be published. Required fields are marked *