Modern versions of Windows defragment drives during regular maintenance schedules.

Windows automatically defragments drives that need it once per week—by default at 1:00 am on Wednesdays.

(And it is smart enough not to defragment SSDs at all.)

How to Add a Defragment Option to the Right-Click Menu for a Drive in Windows

Right-click theshellkey and choose New > Key.

Name the new key “runas.”

Now, you’ll change the(Default)value inside the newrunaskey.

own_1

With therunaskey selected, double-pick the(Default)value to open its properties window.

To to that, right-click therunaskey and choose New > String Value.

Name the new value “Extended.”

dcm_2

You don’t need to make any changes to it.

Just having that string there will cause the command to be hidden behind Shift key access.

You’ll next need to create a new key inside yourrunaskey.

dcm_3

Right-click therunaskey and choose New > Key.

Name the new key “command.”

Now, you’ll change the(Default)value inside the new command key.

dcm_4

With the command key selected, double-smack the(Default)value to open its properties window.

We’ve got a great guide thatdigs deeper into the defrag commandand covers those additional options.

The “Add Defrag to Context Menu” hack adds the defragment command to the regular context menu.

dcm_5

And the “Remove Defrag from Context Menu” removes the command no matter which way you added it.

All three hacks are included in the following ZIP file.

Double-hit the one you want to use and click through the prompts.

dcm_6

Running the hacks just modifies the value.

dcm_7

dcm_8

dcm_9

dcm_10

dcm_11

dcm_12

Windows