删除XP组件  

在Windows组件向导中,有一些Windows组件没有列出来,例如Windows Messenger和写字板(Wordpad),这些组件不能直接用Windows组件向导删除。如果你确实要删除它们,办法还是有的。

  XP通过一个安装配置文件控制Windows组件向导显示出哪些组件,只要修改这个安装配置文件,就可以象删除其他组件一样删除那些本来没有显示在Windows组件向导中的组件。

  安装配置文件的名字是sysoc.inf,在\Windows\INF目录下。sysoc.inf文件的每一行描述一个组件。用记事本打开这个文件,然后找到描述待删除组件的行。删除该行的hide或HIDE单词(不要删除逗号)。例如,如果要删除“三维弹球”游戏,首先找到下面这行内容:

  Pinball=ocgen.dll,OcEntry,pinball.inf,HIDE,7

  把它改成:

  Pinball=ocgen.dll,OcEntry,pinball.inf,,7

  修改好之后保存sysoc.inf文件。打开控制面板,选择“添加或删除程序”,点击“添加/删除Windows组件”启动Windows组件向导,现在可删除的组件清单中已经增加了一个“桌上弹球”。

  sysoc.inf文件中的组件名称是缩写的英文名称,这个英文名称与我们通常看到的中文名称没有明确的对应关系。如果你知道待删除组件的中文名称,要确定它在sysoc.inf文件中的英文名称,办法之一是查看组件的程序名称,例如在开始菜单上用鼠标右键点击组件,查看“属性”对话框的“快捷方式”。但有些组件的程序名称与它在sysoc.inf中的名称略有不同,例如写字板的程序名称是wordpad.exe,它在sysoc.inf文件中的名称是MSWordPad。不管怎样,多试验几次应该能够找到sysoc.inf文件中的名称。表一是本人试验的一些结果。

  表一:

  sysoc.inf名称组件中文名称

  AccessOpt辅助功能向导

  MultiM多媒体组件,包括Media Player、音量控制、录音机

  CommApps通讯组件,包括超级终端、对话、电话拨号程序。

  AutoUpdate Windows自动更新

  TerminalServer终端服务器

  Dtc分布式事务处理协调器

  Com COM+

  WBEM WMI(Windows Management Instrumentation)

  Pinball三维弹球

  MSWordPad写字板

  msmsgs Windows Messenger

 

How to add or remove Windows Components by using Sysocmgr.exe

http://support.microsoft.com/kb/222444/en-us

 

You can use the Sysocmgr.exe tool at a command prompt to add or remove Windows components. You can use the following command-line switches with Sysocmgr.exe:

  • /i:path to Sysoc.inf file, where path to Sysoc.inf file is the full path to the Sysoc.inf file, for example:

    
    c:\windows\inf\sysoc.inf
    						
  • /u:path to answer file, where path to answer file is the full path to the answer file that contains a list of items to add or remove.
  • /q - runs Sysocmgr.exe in quiet mode (without display pages)
  • /r - suppresses reboot (if needed)

Note This procedure does not work and is unsupported with Microsoft Fax Service, Windows Media Player, COM+, and Distributed Transaction Coordinator. These are core components that are not removable. Additionally, in Windows 2000, this procedure does not work with the Microsoft Fax Service. This is because the Microsoft Fax Service is not an individual component in Windows 2000. Instead, the Microsoft Fax Service is a subcomponent of a larger group in Windows 2000.

The answer file can be any Windows answer file and only parses the [Components] and [NetOptionalComponents] sections. An example file is shown below:


[Components]
Netoc = on
Reminst = on
Paint = off
pinball = off
Solitaire = off

[NetOptionalComponents]
lpdsvc = 1
SimpTcp = 1
wins = 1
				

To start the installation or uninstallation of these components using Sysocmgr.exe, type the following command (file saved as c:\ocm.txt):

sysocmgr /i:%windir%\inf\sysoc.inf /u:c:\ocm.txt

For more information, please refer to the unattended documentation.