How to Defragment Disks in Windows 11 in 4 Ways?

How to defragment disks in Windows 11 when the PC becomes sluggish and unresponsive? Here, 4 different ways for disk defrag will be introduced to help easily fix it.


By Michael / Updated on May 12, 2023

Share this: instagram reddit

Do I need to defrag Windows 11?

Over time, your computer can become slower and less responsive no matter how good its specs are. One of the causes is the high fragment rate of its hard drives. Generally, a file on a hard drive is stored in the form of different contiguous segments.

However, after frequent save, resave, or deletion, those segments could get separated from each other and scattered across the hard drive which makes it’s harder to find the file. In this case, the read speed is severely decreased.

To resolve this issue, defrag is an efficient way. By defragging a hard drive, all the files on it will be reorganized – the segments will go back together so the read speed gets increased.


If your hard disk is fragmented over 10%, then, it’s necessary to run a disk defrag for the disk in Windows 11. To check the frag rate, you should go to the Windows defrag tool that I will explain later. And how often should you defrag the disk? Usually, that should be done at least once a week especially if you use the PC quite often.

How to defragment disk in Windows 11?

As far as we’re concerned, a disk defrag is required if it’s over fragmented. Then, how to run a disk defrag in Windows 11? Luckily, you can effortlessly find the top 4 ways for this operation. Check the step-by-step tutorials as follows to get it done correctly.

Way 1. With Windows inbuilt defraggler

Windows 11 provides its own defraggler with which you can defrag your hard drives manually or set a schedule defrag easily.

1. Click on the magnifier icon at the bottom of the desktop. Type “disk defrag”.

2. Under “Best matches”, select “Defragment and Optimize Drives”.

best matches

3. Then, in the “Optimize Drives” window, you can check the current status where the frag rate will be displayed. If it’s over 10%, click on “Optimize” to start a disk defrag. If you want to run a schedule defrag for your PC, hit the “Change settings” button to proceed.


4. Now, tick the option “Run on a schedule” and set the frequency for the defrag and decide which drive to defrag by clicking on “Choose”. After that, click on “OK” to save the changes.

auto defrag

Way 2. Via Command Prompt

Command Prompt is one of the command-line interface programs of Windows to execute different commands. You can give orders to execute a disk defrag in Command Prompt but it can be a little bit tricky as you should be quite familiar with the meaning of different lines. Thus, this program is only recommended to professional users. Then, how do I run defrag on Windows 11 with CMD?

1. Launch Command Prompt (CMD) in Windows 11.

2. In the CMD window, type “defrag/?” and hit “ENTER” which will list all the options supported by the defrag. To run a defrag, input command – “defrag [drive letter] [parameter] [extra parameters]”.

defrag cmd

3. For example, if you want to just defrag the C drive, try the command “defrag C:”; if you hope to analyze the C drive to check whether it needs a defrag, type “defrag C:/A”; or if you wish to defrag all your drives at once, type “defrag/C” and hit the “ENTER” key.

Way 3. Using the batching file

Apart from the traditional defrag tools given by Windows, the batch file is also a available one.

1. Open the notepad.

2. Go to File Explorer to check which drives your computer has (mine are C, D, and E). Then, type the words as follows to the text editor:

@echo off

defrag.exe c: -f

defrag.exe d: -f

defrag.exe e: -f

defrag batch

3. Save the files as a BAT file.

4. Run this with admin privileges to start the disk defrag.

Way 4. Trying a third-party defrag tool

Apart from the above 3 Windows built-in defragglers, here, I’ll recommend a much more powerful third-party software utility to help with disk defrag. AOMEI Partition Assistant Professional is an all-in-one disk manager. It helps its users with different operations in disk management including disk defrag, SSD 4K alignment, and APP moving.

In disk defrag, it not only optimizes the problematic hard drives, but also scores each of them before and after the optimization. The process is faster and never takes too long. Besides, its scheduler defrag feature provides more options than the Windows built-in defraggler does. With it, you can view the scores of each drive before and after the defrag and meanwhile, you can decide precisely at which clock to defrag, during startup or logon to defrag.

Download the demo of the ultimate disk defraggler to enhance the performance of your PC.

Download DemoWin 11/10/8.1/8/7/XP
Secure Download

Step 1. Install and launch AOMEI Partition Assistant Professional. When all hard drives and their partitions appear, right-click the disk, and choose “Disk Defrag”.

disk defrag

Step 2. In the “Disk Defrag window”, you can manually analyze the partition you choose and defrag it. Or you can click on “Schedule” to run a schedule defrag.


Step 3. If you’ve decided to run a schedule defrag and hit the “Schedule” button, then, in the Schedule Settings” window, select the target drive and defrag frequency among daily, weekly, monthly. Meanwhile, you can also decide whether to defrag during startup or logon.


Step 4. Also, as mentioned above, you can decide on what conditions to defrag


After all is done, click on the “OK” button to save the changes.


Defrag is a necessary step to optimize the performance of your PC. Then, how to defragment disks in Windows 11? Here, 4 different ways are introduced to help with disk defrag. Each of them has its own distinctions but after all, AOMEI Partition Assistant Professional contains all the features that the other 3 have as long as what they don’t have. If you’re a Server user but still want to apply this powerful software to your computer, you can try the Server edition.

Michael · Staff Editor
Michael is a professinal editor of AOMEI editor team.