Sometimes, you want quick access to defragment your hard drives. Well, you can save yourself a few clicks by adding the Defragment command to your right click context menu. This can come in handy (although it does nothing to speed up the defrag process itself).
1. Go to Start, type in regedit and press enter (Or you can go to Start, Accessories, Run and type regedit).
2. Navigate to the key HKEY_CLASSES_ROOTDriveshell.
3. Name it defrag (this name can be anything, really).
4. On the right pane, double click the Default value and name the Value Data field with “Defragment“. This text is going to be what you see when you right click a drive, so it is also custom.
5. Right click on the defrag key that you made earlier and choose New and Key.
6. Name it command.
7. Double click the Default value of this key, and change the Value Data with defrag %1 -v.
8. Now, when you right click a drive, you will have the Defragment command available. It does open a Command prompt to do it’s work.