Windows XP Tips 'n' Tricks
4:21 AM
Automatically defrag drives with a new context menu item!
Contributed by Doug Knox
Create a new Registry import file named context_defrag.inf in Notepad (be sure to save with it with the Save as type set to All Files and not Text Documents) and place the following text inside:
; 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"
Then, right-click and choose Install. This will add a context menu to XP that allows you to automatically defrag drives, using the command line version of the built-in defragmentation utility. To use it, navigate to a drive in My Computer, right-click, and choose Defrag. A command line window will appear, and that drive will be defragged. When it's complete, the window just disappears.
UPDATE: To remove this functionality, Open regedit.exe and navigate to the following location:
HKEY_CLASSES_ROOT\Drive\shell\
Then delete the Defrag folder and close Regedit.
Add/Remove optional features of Windows XP
Contributed by Ong Choon Keong and Hans Breemer
I first mentioned this technique in an old Technology Showcase for Windows 2000, but it still works in Windows XP, and can be quite useful: For some reason, Microsoft has removed the ability to specify which Windows components you want to install during interactive Setup, and when you go into Add/Remove Windows Components in the Control Panel, you still don't have the full list of applications and applets you can add and remove. Thankfully, this is easy to fix.
To dramatically expand the list of applications you can remove from Windows XP after installation, navigate to C:\WINDOWS\inf (substituting the correct drive letter for your version of Windows) and open the sysoc.inf file. Under Windows XP Professional Edition, this file will resemble the following by default:
[Version] Signature = "$Windows NT$"
DriverVer=06/26/2001,5.1.2505.0
[Components]
NtComponents=ntoc.dll,NtOcSetupProc,,4
WBEM=ocgen.dll,OcEntry,wbemoc.inf,hide,7
Display=desk.cpl,DisplayOcSetupProc,,7
Fax=fxsocm.dll,FaxOcmSetupProc,fxsocm.inf,,7
NetOC=netoc.dll,NetOcSetupProc,netoc.inf,,7
iis=iis.dll,OcEntry,iis.inf,,7
com=comsetup.dll,OcEntry,comnt5.inf,hide,7
dtc=msdtcstp.dll,OcEntry,dtcnt5.inf,hide,7
IndexSrv_System = setupqry.dll,IndexSrv,setupqry.inf,,7
TerminalServer=TsOc.dll, HydraOc, TsOc.inf,hide,2
msmq=msmqocm.dll,MsmqOcm,msmqocm.inf,,6
ims=imsinsnt.dll,OcEntry,ims.inf,,7
fp_extensions=fp40ext.dll,FrontPage4Extensions,fp40ext.inf,,7
AutoUpdate=ocgen.dll,OcEntry,au.inf,hide,7
msmsgs=msgrocm.dll,OcEntry,msmsgs.inf,hide,7
msnexplr=ocmsn.dll,OcEntry,msnmsn.inf,,7
smarttgs=ocgen.dll,OcEntry,msnsl.inf,,7
RootAutoUpdate=ocgen.dll,OcEntry,rootau.inf,,7
Games=ocgen.dll,OcEntry,games.inf,,7
AccessUtil=ocgen.dll,OcEntry,accessor.inf,,7
CommApps=ocgen.dll,OcEntry,communic.inf,HIDE,7
MultiM=ocgen.dll,OcEntry,multimed.inf,HIDE,7
AccessOpt=ocgen.dll,OcEntry,optional.inf,HIDE,7
Pinball=ocgen.dll,OcEntry,pinball.inf,HIDE,7
MSWordPad=ocgen.dll,OcEntry,wordpad.inf,HIDE,7
ZoneGames=zoneoc.dll,ZoneSetupProc,igames.inf,,7
[Global]
WindowTitle=%WindowTitle%
WindowTitle.StandAlone="*"
The entries that include the text hide or HIDE will not show up in Add/Remove Windows Components by default. To fix this, do a global search and replace for ,hide and change each instance of this to , (a comma). Then, save the file, relaunch Add/Remove Windows Components, and tweak the installed applications to your heart's content.