How to Add “Defragment” in Drive Context Menu on Windows 10

Written by | Categories: Computers - Tips & Tricks - Computers - Windows 10

Do you want to defragment your disks faster?

As you know everyone should defragment their hard drives at least once a week.

This task is done automatically in Windows 10 weekly, but if you want to do it manually it can be a little complicated.

In this tutorial, you will learn a registry hack to add “Defragment” to the right-click menu on the “This PC” window.

Let’s go!

Defragment Your Hard Disks from the Context Menu on “This PC”

Open the Run prompt using the Windows+R keyboard shortcut, type in regedit, hit Enter.

Navigate to this path:


Right-click on shell and choose “New” > “Key“. Name the newly created key Defragment.

Click on the “Defragment” key you created and create a new String Value named icon with the value defrag.exe.

Right-click on the “Defragment” key and choose “New” > “Key“. Name the new key command.

Change the value of the (Default) value under the key command to dfrgui.exe.

Now open your Windows Explorer, right-click on your C: drive, you should see a “Defragment” item.

All you have to do now is to click “Optimize“.

Bonus Tip: Defragment a Drive from Command Prompt

Here is a bonus command to defragment any hard drive using the age-old Command Prompt:

defrag C: /O

Now that you know how to optimize and defragment your hard drives using the right-click menu, it’s time to discover other useful & easy tutorials on ;)

If you have any questions about Windows 10 or defrag please leave a comment below.

The author:

Soufiane is a young computer scientist and specialist in web design, knows a lot of things in the computer world. This enthusiast enjoys helping people innovate and learn more about the IT world...

Write a comment:

xD oO ^_^ =] =) ;-( ;) :| :woot: :whistle: :sleep: :sick: :police: :p :o :ninja: :mm: :love: :lol: :kiss: :hmm: :evil: :bandit: :angel: :alien: :D :) :( 8)