Install Windows Components from Command Line |
|
Posted Monday, 09 July 2007 by Michael Khanin %windir%\system32\sysocmgr.exe /i:%windir%\inf\sysoc.inf This parameter (/i:) is always required and specifies the location of the master inf (%windir%\inf\sysoc.inf). When run it simply displays the Windows Components Wizard. Therefore the above command can be used as a shortcut directly to the Windows Components Wizard. The real power of sysocmgr is in unattended mode. Additional parameters control the user interface, handle restarting, and control which components are added or removed by way of a standard Windows unattended answer file. Sysocmgr only looks in the [Components] and [NetOptionalComponents] sections, so the answer file can be specifically for component management or reused from a Windows unattended installation. Some components have their own unattended answer file sections, which are also parsed. The following example uses an answer file (/u:) named ocm.txt in the temporary directory (%temp%\ocm.txt), suppresses any necessary restart (/r), and displays no user interface (/q): %windir%\system32\sysocmgr.exe /i:%windir%\inf\sysoc.inf /u:%temp%\ocm.txt /r /q The following example answer file adds the Simple Network Management Protocol (SNMP) service and configures the agent settings: [NetOptionalComponents] SNMP = 1 [SNMP] Contact_Name = Michael Khanin Location = Canada Service = Physical, Applications, End-to-End Community_Name = Public Traps = server1.thesystemadministrator.com, server2.thesystemadministrator.com Send_Authentication = Yes Accept_CommunityName = Public:Read_Only Any_Host = No Limit_Host = server1.thesystemadministrator.com, server2.thesystemadministrator.com Tips:
runas /user:admin "%windir%\system32\sysocmgr.exe /i:%windir%\inf\sysoc.inf"
|