How to disable automatic defragmentation in Windows 10? It is scanning my 2 TB HDD for 2 hours already and lags too much.


In addition to the method geotavros described, another method for turning off automatic defrag/optimization can be accomplished by doing the following....

  1. Click on the Start Menu
  2. Start typing Defrag and you'll see an option come up called Defragment and Optimize Drives. Select that.
  3. Make sure the drive you want to turn off defrag/optimize is highlighted and then click on Change Settings.
  4. Uncheck the box that says Run on a schedule
  5. Click on OK and you're done.

enter image description here

| improve this answer | |
  • 1
    Seems like defrag will be turned off for all drives instead of just the selected drive, same for turning it on. Have W10 Home V1709 – Wouter Vanherck Apr 19 '18 at 18:50
  • How did you create this gif ? @n8te – Chaminda Bandara Sep 28 '18 at 3:56
  • 1
    @ChamindaBandara - I used a program called Peek. It's only available for Linux. I made a remote desktop connection from my Linux PC to a Windows laptop and recorded the Windows desktop from my Linux PC using Peek. – n8te Sep 28 '18 at 4:03
  • @ChamindaBandara Use ScreenToGif. – Biswapriyo Sep 28 '18 at 10:15

Alternative process with Command Prompt::

  • Run Command Prompt as administrator and run the command schtasks /Delete /TN "\Microsoft\Windows\Defrag\ScheduledDefrag" /F

delete scheduled defragmentation with cmd

  • /TN option specifies the path\name of the task to delete.

  • /F option forcefully deletes the task and suppresses warnings if the specified task is currently running.

| improve this answer | |
  • How can I defrag specific drive like C, D ? – Chaminda Bandara Sep 28 '18 at 4:46
  • @ChamindaBandara Command as admin: defrag C: /U /V. – Biswapriyo Sep 28 '18 at 6:16

You can disable it via the Task Scheduler > Task Scheduler Library > Microsoft > Windows > Defrag > then disable the "ScheduledDefrag".

| improve this answer | |

Open an administrative cmd prompt (or Powershell, up to you) and execute:

schtasks /Change /DISABLE /TN "\Microsoft\Windows\Defrag\ScheduledDefrag"

This command disables the task, just as the original question asks and is a faster, cmd line-based solution that functions identically to the top GUI answer from n8te.

This doesn't delete the task, which means that if you decide you need it enabled again at a later date, simply change DISABLE to ENABLE and run again in an elevated admin prompt:

schtasks /Change /ENABLE /TN "\Microsoft\Windows\Defrag\ScheduledDefrag"
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.