One of the major reasons of behind slow computer is over time, files on your hard drive get fragmented. To get them optimize you need to defragment the drive. Optimizing your drives can help your PC run smoother and boot up faster. By default there is an in-built tool for Windows 10 which helps to analyze and optimize the drive.

Using Defrag Tool:

  • In Start Search Type Defrag.
  • Select Defragment and Optimize Drives.
  • Select the disk drive you want to optimize.
  • Click on Analyze tab to find out if it requires optimization.
  • If it requires then click Optimize.
  • If you like to schedule then click Change settings: Here you can choose Frequency and drive according to your need.

Via PowerShell

  • Open PowerShell as Administrator.
  • To Analyze type the following command:
Optimize-Volume -DriveLetter <drive letter> -Analyze –Verbose

For example, if you like to analyze C:

Optimize-Volume -DriveLetter C -Analyze -Verbose

To directly Optimize:

Optimize-Volume -DriveLetter <drive letter> -Verbose

For example, if you like to optimize Drive H:

Optimize-Volume -DriveLetter H -Defrag -Verbose

For SSD optimization use the following command:

PS C:\>Optimize-Volume -DriveLetter H -ReTrim -Verbose

Be careful, SSD disks (solid state, with chip based storage) handle defragmentation differently by nature, and you should not defrag them like you would do for legacy magnetic hard disks.
In worst case scenario, defragmenting SSD might cause damage to the disk.

See Also