Google-Translate-Swedish Google-Translate-English to French Google-Translate-English to German Google-Translate-English to Italian Google-Translate-English to Dutch Google-Translate-English to Portuguese Google-Translate-English to Russian BETA Google-Translate-English to Spanish
Windows 7 - how-to-add-defragment-and-disk-cleanup-to-the-right-click-menu-of-a-drive

To keep your computer running optimally, you should regularly run such tools as Disk Defragmenter and Disk Cleanup. Both of these utilities help to improve the performance of your hard disk and keep your computer tidy. Disk Defragmenter makes your computer run faster by rearranging all of the data on your hard drive so that it is stored contiguously, rather than being scattered all over the physical hard drive. Disk Cleanup cleans your computer of unused files, such as temporary files, old backup files and those contained in the recycle bin.

Both of these features should be used fairly regularly, so it's convenient to have them as available options when you right-click on a drive in Windows Explorer. To enable these options, you'll need to use the registry editor.

The registry editor is a particularly powerful tool for modifying advanced system settings. Using it should be done with care. Only follow the instructions below and do not change any other registry entries that you are not familiar with. Doing so could cause your computer to stop working.

If you do not feel comfortable editing the registry, you can also find some downloadable registry modification files which provide an easy way to add these extra commands to Windows Explorer. This is much easier, but it does not give you the opportunity to start familiarizing yourself with the Windows registry.

1 - Adding Defragment
Open up the registry editor by typing "regedit" in the start menu search box and pressing Enter. Navigate to "HKEY_CLASSES_ROOT\Drive\shell."
Right-click on the folder "shell" and create a new key. Name the key "runas." In the right-hand side, you'll see "(default)." Double-click on the icon and type in "Defragment."
Right-click your new key "runas" and create another new key. Call this one "command."
Double-click on the default value in the new key to edit it. Enter "defrag %1 -v."
Once you restart the Windows Explorer, you'll now see the "Defragment" option when you right-click on any drive attached to your computer.

2 - Adding Disk Cleanup
Return to the registry editor and go back to "HKEY_CLASSES_ROOT\Drive\shell." Create another new key in this folder and name it "diskcleanup." The default value should be changed to "Disk Cleanup."
As before, create another key under the "diskcleanup" folder and call it "command." Edit the default value and change it to "cleanmgr.exe / %1". The new option should now appear in the "Computer" section of Windows Explorer.


Microsoft Windows is a registered trademark of Microsoft Corporation in the United States and other countries. Speed improvements vary based on your system configuration. ErrorTeck is not endorsed or affiliated with either Microsoft or the third party applications it supports.