- How to erase my hard drive and start over
- Erasing the hard drive and reinstalling Windows
- Windows 10
- Windows 8
- Windows 7 and Vista
- Windows XP and 2000
- Earlier versions of Windows and DOS
- Formatting the drive
- Windows NT 4.0
- Windows 95 with a backup CD
- erase
- Syntax
- Parameters
- Remarks
- Examples
- How to refresh, reset, or restore your PC
- Before you start to refresh or reset your PC
- Refresh, reset, or restore
- To refresh your PC
- To reset your PC
- To restore your PC to an earlier point in time
How to erase my hard drive and start over
Most computers have a system restore disc or built-in restore process on the hard drive to reset the computer to the original settings, also known as a factory reset. Resetting, formatting, or restoring, a computer helps eliminate issues with computer software, including corrupt program files and virus infections. Instructions on how to restore your computer back to the original software are provided below.
Restoring your computer erases all the information on the hard drive and makes it like new. Once the steps below are completed, you cannot restore any lost data. Back up any files you do not want to lose before proceeding with the restore process.
If you have an OEM computer (e.g., Acer, ASUS, Dell, or HP), you likely have a hidden system recovery partition and don’t need a disc to restore your computer.
Erasing the hard drive and reinstalling Windows
To erase your hard drive and reinstall Windows, follow the steps below for your version of Windows.
If you’re erasing everything and reinstalling Windows, an administrator login name or password isn’t needed.
Windows 10
Follow these instructions to erase or uninstall and reinstall Windows 10.
- Open the Start menu.
- Select the Settings option (looks like a gear).
- In the Settings window, select the Update & security option.
- Select the Recovery option in the left navigation pane.
- Click the Get Started button in the «Reset this PC» section.
- Choose either the Keep my files or Remove everything option, depending on if you want to preserve your files or delete everything and start over.
- Follow the prompts to begin the recovery process.
Windows will be reset, either keeping your files intact or erasing everything, depending on the option you selected.
Windows 8
Follow these instructions to erase and reinstall Windows 8.
- Press the Windows key + C to open the Charms menu.
- Select the Search option and type reinstall in the Search text field (do not press Enter ).
- Select the Settings option.
- On the left side of the screen, select Remove everything and reinstall Windows.
- On the «Reset your PC» screen, click Next.
- On the «Do you want to fully clean your drive» screen, select Just remove my files to do a quick deletion or select Fully clean the drive to have all files erased.
- On the «Ready to reset your PC» screen, click Reset.
The hard drive will be erased, and Windows 8 will be reinstalled.
Windows 7 and Vista
To restore a Windows 7 or Vista computer, you must have a set of restore discs for the computer or an original Windows 7 or Vista installation disc. If you do not have a set of restore discs, contact the computer manufacturer to order a new set or restore discs.
Before following the steps below, make sure the computer is set to boot from the CD-ROM drive.
- How to boot from a CD or DVD in a computer.
- Insert the Windows 7 or Vista installation CD in the CD-ROM drive and restart the computer.
- When you see the message «Press any key to boot from CD,» press a key on the keyboard.
- Press Enter at the Windows Setup welcome screen.
- When prompted, press any key on your keyboard.
- On the «Install Windows» page, select your preferred language and other preferences, then click Next.
- On the License Agreement page, accept the terms and agreements and click Next.
- On the Installation Type screen, choose the Custom option.
- Select the Drive Options (advanced) option.
- For Disk 0, delete all partitions. When all partitions are deleted, a single entry named «Unallocated space» should be seen.
- Click Disk 0 and select Next.
The Windows installation process starts by creating a new partition, formatting the partition, and installing Windows on the hard drive. The formatting process erases the hard drive before installing Windows.
Windows XP and 2000
To restore a Windows XP or 2000 computer, you must have a set of restore discs for the computer or an original Windows XP or 2000 installation disc. If you do not have a set of restore discs, contact the computer manufacturer to order a new set or restore discs.
Before following the steps below, make sure the computer is set to boot from the CD-ROM drive.
- How to boot from a CD or DVD in a computer.
- Insert the Windows XP/2000 installation CD in the CD-ROM drive and restart the computer.
- When you see the message «Press any key to boot from CD,» press a key on the keyboard.
- Press the Enter key at the Windows XP Setup welcome screen, then press F8 to accept the Terms and Agreements.
- Follow the on-screen instructions to select a hard drive partition to format and install Windows XP on.
- After formatting the hard drive, which erases all data, see our steps for reinstalling Windows.
- How to install the Microsoft Windows operating system.
Earlier versions of Windows and DOS
Follow these instructions to erase and reinstall MS-DOS 5.0+, Windows 3.x, 95, 98, ME, or NT 4.0.
Formatting the drive
- Place the bootable diskette or disc inside the computer and reboot to get to the DOS prompt. In some cases, you may need to boot the computer with CD-ROM support or press a key to boot from the disk.
- At the MS-DOS prompt type, format c: /s
If the «format c: /s» command does not work, you may need to download the format.com file to your boot disk.
- The computer asks you «Are you sure you want to erase everything on drive c:»
- If you are ok with doing this, press «Y» for yes and press Enter .
- After doing this, the computer begins the formatting process. While the computer is formatting, make sure no errors are encountered.
- I’m getting bad sectors, clusters, or missing allocations.
- Once the format process is completed successfully, at the MS-DOS prompt, type «fdisk /mbr» and press Enter . After entering this command, it should return you to the MS-DOS prompt with no message. This step is not required, but recommended.
- Do you have additional information on fdisk /mbr?
- Once back at the MS-DOS prompt, reboot the computer with the boot disk still inserted and follow the steps below to reinstall Windows on the hard drive.
Windows NT 4.0
Windows NT can be installed in different ways. We recommend Windows NT be installed using the steps below as we feel that these steps by far are the easiest way to install Windows NT 4.0.
First, we recommend all users wanting to install Windows NT use the /b switch, which allows the users to not need to create the diskettes. We do, however, recommend the user create the emergency recover diskettes if they have not already been created after the installation of Windows NT.
Finally, before the installation of Windows NT, we recommend you run smartdrv, which helps the installation of Windows NT run a lot faster.
- Place the CD into the computer.
- Type X: (where x is the CD-ROM drive, often this is D:).
- Once at the appropriate drive, type cd winnt and press Enter to get into the Windows 95 directory.
- Once at X:\WINNT> type winnt /b.
- Follow the on-screen instructions to complete the installation.
Windows 95 with a backup CD
- Place the CD into the computer.
- Type X: (where x is the CD-ROM drive, often this is D:).
- Once at the appropriate drive, type cd win95 and press Enter to get into the Windows 95 directory.
- Once at X:\WIN95> type setup to begin the installation.
- Follow the on-screen instructions to complete the installation.
If you are encountering issues during the setup process, you can add additional switches to the setup command line. These switches are on our Windows 95 setup switches page.
erase
Deletes one or more files. If you use erase to delete a file from your disk, you can’t retrieve it.
This command is the same as the del command.
Syntax
Parameters
Parameter | Description |
---|---|
Specifies a list of one or more files or directories. Wildcards may be used to delete multiple files. If a directory is specified, all files within the directory will be deleted. | |
/p | Prompts for confirmation before deleting the specified file. |
/f | Forces deletion of read-only files. |
/s | Deletes specified files from the current directory and all subdirectories. Displays the names of the files as they are being deleted. |
/q | Specifies quiet mode. You are not prompted for delete confirmation. |
/a[:] | Deletes files based on the following file attributes:
|
/? | Displays help at the command prompt. |
Remarks
If you use the erase /p command, you’ll see the following message:
FileName, Delete (Y/N)?
To confirm the deletion, press Y. To cancel the deletion and to display the next file name (if you specified a group of files), press N. To stop the erase command, press CTRL+C.
If you disable command extension, the /s parameter will display the names of any files that weren’t found ,instead of displaying the names of files that are being deleted.
If you specify specific folders in the parameter, all of the included files will also be deleted. For example, if you want to delete all of the files in the \work folder, type:
You can use wildcards (* and ?) to delete more than one file at a time. However, to avoid deleting files unintentionally, you should use wildcards cautiously. For example, if you type the following command:
The erase command displays the following prompt:
Are you sure (Y/N)?
To delete all of the files in the current directory, press Y and then press ENTER. To cancel the deletion, press N and then press ENTER.
Before you use wildcard characters with the erase command, use the same wildcard characters with the dir command to list all the files that will be deleted.
Examples
To delete all the files in a folder named Test on drive C, type either of the following:
To delete all files with the .bat file name extension from the current directory, type:
To delete all read-only files in the current directory, type:
How to refresh, reset, or restore your PC
Note: For information about this topic in Windows 10, see Recovery options in Windows 10.
If you’re having problems with your PC, you can:
Refresh your PC to reinstall Windows and keep your personal files and settings. Refresh also keeps the apps that came with your PC and the apps you installed from the Microsoft Store.
Reset your PC to reinstall Windows but delete your files, settings, and apps—except for the apps that came with your PC.
Restore your PC to undo recent system changes you’ve made.
If you’re having trouble starting (booting) your PC, see Windows Startup Settings (including safe mode), and go to the “Get to Windows Startup Settings in the Windows Recovery Environment” section. You can refresh, reset, or restore your PC from the Windows Recovery Environment.
If you want to back up and restore your personal files using File History, see Set up a drive for File History.
Before you start to refresh or reset your PC
In most cases, once you start to refresh or reset your PC, it’ll finish on its own. However, if Windows needs missing files, you’ll be asked to insert recovery media, which is typically on a DVD disc or thumb drive. If that happens, what you’ll need depends on your PC.
If your PC came with Windows 8.1 or Windows RT 8.1, you’ll need the discs or thumb drive that came with your PC. Check the info that came with your PC to see if your PC manufacturer provided these discs or media. In some cases, you might have created them when you first set up your PC.
If you don’t have either of those, you can make them if you have a USB thumb drive of 16 GB or larger. Having a recovery drive can help you troubleshoot and fix problems with your PC, even if it won’t start. For more info, see Create a USB recovery drive.
If you upgraded your PC to Windows 8.1 or Windows RT 8.1 with a DVD, use that disc. If you don’t have Windows 8.1 or Windows RT 8.1 media, contact Microsoft Support.
Refresh, reset, or restore
Select any of the following for more detailed info.
If your PC isn’t performing as well as it once did, and you don’t know why, you can refresh your PC without deleting any of your personal files or changing your settings.
Note: If you upgraded your PC from Windows 8 to Windows 8.1 and your PC has a Windows 8 recovery partition, refreshing your PC will restore Windows 8. You’ll need to upgrade to Windows 8.1 after the refresh has finished.
Warning: Apps you installed from websites and DVDs will be removed. Apps that came with your PC and apps you installed from Microsoft Store will be reinstalled. Windows puts a list of removed apps on your desktop after refreshing your PC.
To refresh your PC
Swipe in from the right edge of the screen, tap Settings, and then tap Change PC settings.
(If you’re using a mouse, point to the upper-right corner of the screen, move the mouse pointer down, click Settings, and then click Change PC settings.)
Tap or click Update and recovery, and then tap or click Recovery.
Under Refresh your PC without affecting your files, tap or click Get started.
Follow the instructions on the screen.
If you want to recycle your PC, give it away, or start over with it, you can reset it completely. This removes everything and reinstalls Windows.
Note: If you upgraded your PC from Windows 8 to Windows 8.1 and your PC has a Windows 8 recovery partition, resetting your PC will restore Windows 8. You’ll need to upgrade to Windows 8.1 after the reset has finished.
Warning: All of your personal files will be deleted and your settings will be reset. All apps that you installed will be removed. Only apps that came with your PC will be reinstalled.
To reset your PC
Swipe in from the right edge of the screen, tap Settings, and then tap Change PC settings.
(If you’re using a mouse, point to the upper-right corner of the screen, move the mouse pointer down, click Settings, and then click Change PC settings.)
Tap or click Update and recovery, and then tap or click Recovery.
Under Remove everything and reinstall Windows, tap or click Get started.
Follow the instructions on the screen.
Note: You’ll be asked to choose whether you want to erase data quickly or thoroughly. If you choose to erase data quickly, some data might be recoverable using special software. If you choose to erase data thoroughly, this will take longer but it makes recovering data less likely.
If you think an app or driver that you recently installed caused problems with your PC, you can restore Windows back to an earlier point in time, called a restore point. System Restore doesn’t change your personal files, but it might remove recently installed apps and drivers.
System Restore isn’t available for Windows RT 8.1.
Windows automatically creates a restore point when you install desktop apps and new Windows updates, if the last restore point is older than 7 days. You can also create a restore point manually at any time.
To restore your PC to an earlier point in time
Swipe in from the right edge of the screen, and then tap Search.
(If you’re using a mouse, point to the upper-right corner of the screen, move the mouse pointer down, and then click Search.)
Enter Control Panel in the search box, and tap or click Control Panel.
Enter Recovery in the Control Panel search box, and then tap or click Recovery.
Tap or click Open System Restore, and then follow the instructions.
If you need additional help refreshing, resetting, or restoring your PC, check out the Repair and Recovery community pages in the Windows forum for solutions that other people have found for problems they’ve experienced.