출처 : http://itknowledgeexchange.techtarget.com/network-administrator/install-windows-components-from-command-line/
Install Windows Components from Command Line
Windows XP and Windows Server 2000 / 2003 have a built-in utility called the System stand-alone Optional Component Manager (sysocmgr.exe) to programmatically add or remove Windows components. Running sysocmgr.exe with no parameters will display the usage. The most basic command line is:
%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:
- Sysocmgr can only be run by users with local administrative rights. It can be combined with runas, e.g.,
runas /user:admin “%windir%\system32\sysocmgr.exe /i:%windir%\inf\sysoc.inf”
- Make sure that the target system has the Windows installation source available. The following registry values must point to a source to which the administrative user has access (e.g., if a network path, a local administrator account may not be able to access it):
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup]
“SourcePath”=”c:\\windows\\i386″
“Installation Sources”= … (REG_MULTI_SZ value)
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion]
“SourcePath”=”c:\\windows\\i386″
'Windows' 카테고리의 다른 글
netlogon 로그 오류 코드 (0) | 2013.06.04 |
---|---|
Raid Controller Driver 설치 ( 구 서버 ) (0) | 2013.05.08 |
Windows에서 디스크 용량 보기 명령어 (0) | 2013.01.09 |
windows server 2008 제품군별 기능 차이 (0) | 2013.01.02 |
net advfirewall firewall 사용 방법 (0) | 2012.11.20 |