To perform a factory reset of Windows 7/8/8.1/10/11 from the command prompt, you can use the "push-button reset" feature. Here's how you can do it:
Open Command Prompt as an administrator. You can do this by searching for "Command Prompt" in the start menu, right-clicking on it, and selecting "Run as administrator."
In the Command Prompt, input the following command and hit Enter:
Copy code and past in the command prompt
systemreset -factoryreset
A new window titled "Reset this PC" will open. Click on the "Get started" button.
You'll encounter a choice: preserve your files or erase everything. Opt for the latter to initiate the factory reset.
Follow the on-screen instructions to complete the reset process. Windows will reinstall itself, and your PC will be reset to its factory settings.
Please note that performing a factory reset will remove all your personal files, apps, and settings. Before proceeding, ensure you've safeguarded any critical data by backing it up.