Add Defragment to the Shell menu in Windows 7 / Vista
Posted By Chris Stinson in Windows on March 10, 2010
I find adding common tasks to the shell menu a great timesaver when I am running between stations. It is also easier to direct users to simply “right-click” on something rather than walk them through a maze of menus…or even have them find the “run” box.
- Click Start -> type “regedit” in the Search command box.
- Navigate to HKEY_CLASSES_ROOT\Drive\shell.
- Right-click on “shell” and select New -> Key. Name it “runas” and set the default value to “Defragment”.
- Right-click on “runas” and select New -> Key. Name it “command” and set the default value to “defrag %1 -v“.
- If you ever wish to remove this functionality, just delete the “runas” key.
You can also paste the following into Notepad and save it as: RightClickDefragment.reg or you can download the zipped RightClickDefragment.reg here. Double-click on the .reg file and click “yes” when asked to enter it into the registry.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Drive\shell\runas]
@=”Defragment”
[HKEY_CLASSES_ROOT\Drive\shell\runas\command]
@=”defrag %1 -v”
Related posts:
- Print Directory Listing in Windows
- Windows Vista Service Pack 1 Released: Improvements!
- Disabling Windows Search in Vista: Stop hard drive running constantly
- Windows: Scheduling Tasks via Command Line
- Windows 2008 / Vista Service Pack 2 Beta Download Available NOW


