Why optimize/defrag helps
- HDDs: Defragmentation groups file fragments to reduce seeks and improve load speed.
- SSDs: TRIM lets the drive manage free blocks for steadier writes and longevity.
- Stability: Fewer I/O stalls/timeouts that can cascade into app faults and DLL load errors.
Open Optimize Drives
- Open File Explorer, right-click the drive (e.g.,
C:) → Properties. - Go to the Tools tab → Optimize.
Start optimization
In Optimize Drives, select the disk and click Optimize.
Windows automatically chooses the correct action per media type (defrag for HDD, TRIM for SSD).
Let optimization complete
Larger or heavily fragmented disks can take longer—let the process finish without interruption.
Set a schedule
In the Optimize Drives window, click Change settings to enable automatic maintenance.
- Frequency: Weekly is a good default.
- Drives: Include all fixed disks. External/removable drives can be excluded.
SSD vs HDD guidance
- SSDs: No manual defrag needed. Use Optimize (TRIM). Occasional SSD defrag by Windows (to maintain restore points) can be normal.
- HDDs: If the disk is very fragmented or nearly full, let defrag complete with minimal background workload.
- After maintenance: A restart isn’t required, but can help clear lingering handles/services.
Caution
Avoid frequent manual defrags on SSDs. Prefer TRIM or the scheduled maintenance Windows provides.
Command-line options
From an elevated Command Prompt:
defrag C: /O /U /V REM Optimize volume (choose best action) defrag /C /O /U /V REM Optimize all volumes defrag C: /L /U /V REM ReTrim (SSD)
PowerShell equivalents:
Optimize-Volume -DriveLetter C -Analyze -Verbose Optimize-Volume -DriveLetter C -Optimize -Verbose Optimize-Volume -DriveLetter C -ReTrim -Verbose