Defragment Drives Easily from Right Click – Context Menu


For the system to work smoothly, the hard disk must be defragmented regularly. However, using the Start menu to open the Disk Manager each time becomes cumbersome. With an entry in the registry, you can expand the context menu for disk drives to include the command to defragment them directly from the right click context menu.

  • Select ‘Start > Run’, enter ‘regedit’ and press [Enter].
  • In the Registry Editor, navigate to the key ‘HKEY_CLASSES_ROOT\Drive\shell’.
  • There, create a sub-key ‘Defrag’ through ‘Edit > New > Key’. This is only the name of the entry in the context menu.
  • Under that create the sub-key ‘Command’ for the actual program call.
  • Now select the ‘Command’ key by clicking it and then double-click on the character string ‘Default’ in the right pane.
  • In the following dialog box, enter the ‘Value data’ with the following command ‘Defrag.exe %1’. The variable ‘%1’ gives the selected disk drive letter to the tool ‘defrag.exe’.
  • Close the registry.

The change is immediately effective without having to restart the computer. Now as soon as you right-click on any drive in Windows Explorer, you can defragment it through the new context menu item you just created.

Note: To create a key in the registry and to use the new context command you must be logged on to the computer with administrator rights.

Comments

Leave a Reply to Arun Shivaram