Hello @Koh Jun Hao
Thank you for clarifying more on this issue and below is the response.
Practical Defragmentation Thresholds.
Microsoft does not define a strict fragmentation percentage for triggering defragmentation.
In practice, many administrators use 20–25% fragmentation as a reasonable threshold.
For latency‑sensitive workloads (databases, accounting software), you may prefer 15–20%.
This aligns with general industry practice and balances performance with maintenance overhead.
Reference: Optimize Drives (Microsoft Learn) (learn.microsoft.com in Bing)
Power & Idle Conditions for Automatic Maintenance.
For Automatic Maintenance and ScheduledDefrag to run successfully:
- Power: Ensure the PC is plugged in (on laptops).
Idle state: The system must be idle for several minutes; active user input or heavy CPU/disk activity postpones tasks.
Sleep/hibernate: If the PC sleeps during the scheduled window, the task may be skipped unless “Wake the computer to run this task” is enabled in Task Scheduler.
Automatic Maintenance: Confirm it is enabled under Control Panel → Security and Maintenance → Automatic Maintenance.
Reference: Automatic Maintenance in Windows (Microsoft Learn) (learn.microsoft.com in Bing)
Why It May Not Run on One PC.
- Drive type: Windows disables defragmentation on SSDs (it runs “Optimize” instead). On HDDs, defrag should run normally.
Task Scheduler settings: Check Task Scheduler → Microsoft → Windows → Defrag → ScheduledDefrag. If disabled or modified, the task will not run.
Idle detection: If background processes prevent idle state, the task may not trigger.
Group Policy/registry: Policies disabling maintenance or defrag can block execution.
Reference: Task Scheduler Overview (Microsoft Learn) (learn.microsoft.com in Bing)
Logs & Event IDs to Collect.
To diagnose why ScheduledDefrag isn’t running:
- Task Scheduler History Enable history for the ScheduledDefrag task.
Look for “Task triggered” and “Task completed” entries. Event Viewer → Applications and Services Logs → Microsoft → Windows → Defrag → Operational Event ID 258: Defrag started. Event ID 259: Defrag completed. Event ID 264: Optimization skipped. Event Viewer → Microsoft → Windows → TaskScheduler → Operational Event ID 100: Task started. Event ID 200: Task completed. Event ID 201: Task failed.
Reference: Event IDs for Task Scheduler (Microsoft Learn) (learn.microsoft.com in Bing)
Note**:** Set a 20–25% fragmentation threshold for your operational policy. Ensure Automatic Maintenance is enabled, the PC can reach idle state, and ScheduledDefrag is not disabled. Collect Task Scheduler history and Defrag Operational log (Event IDs 258–264) to identify why the task isn’t executing on the affected PC.
I hope this helps to better understand the diagnostic options available and the risks involved.
If this information was helpful, please click Accept Answer.
Thank you for choosing Microsoft Q&A.