If your Windows 10 computer is operating slowly or acting strangely, or if you just want to sell it, you should conduct a factory reset. Here’s how to use Command Prompt to reset your computer to factory settings.
Enter this command into Command Prompt and press the Enter key.
Do note that if you remove the files and clean the drive, it does make it more difficult for someone to recover those files—but it’s not impossible.
When the factory reset is finished, the first setup screen will display, as if you had just taken it out of the box.