How to Add Defrag Command in Windows XP Context Menu
In this tutorial we are going to see how defrag command can be added to Windows XP context menu to launch the command line version of Windows XP’s built in defragmenter utility.
Step 1: Open Notepad. Notepad can be opened by Start>Run>type “Notepad”
Step 2: Now copy and paste the following code which is given below
; context_defrag.INF
; Adds Defrag to the right click context menu in Windows XP
[version]
signature=”$CHICAGO$”
[DefaultInstall]
AddReg=AddMe
[AddMe]
HKCR,”Drive\Shell\Defrag\command”,,,”DEFRAG.EXE %1″
Step 3: Save the file by setting Save As type to All Files and not the default text document setting with the file name context_defrag.INF Refer to the screenshot given below. (Click on the image to enlarge)

Step 4: Now right click the file that you just created and click install. Refer to the screen shot given below.

Step 5: Now go and right click your computer’s hard drive and you can see the defrag command listed in the context menu. Refer to the screen shot given below.

Step 6: Now if you click that you can see the windows command line version of defrag.exe in action.

Found via Carol’s Vault
If you liked this article, click here to buy me a Beer! :) If you enjoyed this post, make sure you subscribe to my RSS feed!
Is somebody out there who can help on a simalar problem? When I rightclick in Explorer (filemanager) a batchfile, e.g. example.bat, then in the opening context menu is no “open with” and no “edit” option. Both are missing. How can I restore (probably in the registry) the Explorer context menu to its original standard? Or should I create new entries or look after mistakes in registry entries for each option? I yes, where are the adequate entries stored? Thanks for any help, with regards H.O.