Windows 7: Add Defragment Option to Right-click Menu

Posted October 26, 2010 by Siddharth Bose in Windows 7

Defragmenting the hard disk is an essential operation. However, many people do not like to schedule defragmentation to be performed automatically. By adding the defragment option to a drive’s right-click context menu, you can manually defragment quickly and easily.

Open the Run dialog by pressing the Windows key and “R” or start a new task from the Task Manager.

Start the Registry Editor by typing “regedit” into the run dialog and press enter.

Go to HKEY_CLASSES_ROOT  >>  Drive >> shell in the left pane.

d

Right-click on shell and create a new key called “runas”.

Set the default value of runas in the right pane to “Defragment” by double-clicking on it.

Right-click on runas and create a new key called “command”.

Set the default value of command in the right pane to “defrag %1 –v -u” by double-clicking on it.

Restart the computer.

The right-click menu of the drives now will display the defragment option. When selected, it will start the defragmentation of that drive.

The Conversation

Follow the reactions below and share your own thoughts.

  • sunpie

    I too dont find scheduling very reliable. Also in Windows 7 there is no true automatic feature like a commercial automatic defrag would offer, something like a ‘set it to run in background and never have to bother about defrag again.’