How to Add Defargment Option to the Context Menu of a Drive in Windows Vista?



This tutorial tells you how to add Defragment option to a drive context menu which eases your work of defragmenting it.

Drive context menu with Defragment option:



Figure 1



Note: You will get to see the Command Prompt version of the Defragmentation process of the drive through this setting.

To accomplish this follow these steps:

1) Open Registry Editor and expand the branch

HKEY_CLASSES_ROOT \ Drive \ shell in the left pane



Figure 2


2) Create a new key by right clicking on the shell key and choosing New and then Key options

3) Name it as runas and double click the Default value option in the right pane



Figure 3


4) Now type Defragment in the textbox and click OK button



Figure 4


5) Create a new key by right clicking on the runas key and choosing New and then Key options



Figure 5


6) Name it as command and double click the Default value option in the right pane



Figure 6


7) Type defrag %1 –v in the textbox and click OK button



Figure 7


8) You can now right click on a drive and defargment it as show in Figure 1 and 2


More Vista articles