O'Reilly Hacks
oreilly.comO'Reilly NetworkSafari BookshelfConferences Sign In/My Account | View Cart   
Book List Learning Lab PDFs O'Reilly Gear Newsletters Press Room Jobs  


 
Buy the book!
Windows Server Hacks
By Mitch Tulloch
March 2004
More Info

HACK
#67
Unattended Installation of Windows Components
Here's a simple way you can add or remove system components when deploying Windows 2000 and later
[Discuss (5) | Link to this hack]

If you're responsible for administering a large number of computers, you appreciate methods of automating common administrative tasks. A need to add or remove individual system components might result from a change in corporate policy, discovery of security vulnerability, or simply a newly emerged business need. Using sneakernet for such tasks might take considerable amount of time.

Fortunately, Microsoft provides a way to accomplish this task in an unattended way. Windows 2000 and XP contain the SYSOCMGR.EXE file in the %systemroot%\system32 folder. When executed, this command-line utility analyzes the content of two files: sysoc.inf (the existing configuration file, located in %systemroot%\inf folder) and a specially formatted text file (which you can give an arbitrary name) that contains a listing of components to be added or removed.

The sysoc.inf file is used by Windows when running the Add/Remove Programs applet in the Control Panel. It's format is typical of standard .inf files: it is divided into several sections, each starting with a name enclosed in square brackets. The [Components] section consists of multiple lines, one per component. Each line starts with the component name, followed by references to .dll and .inf files used during installation or uninstallation. Hide entry determines whether the component appears in Add/Remove Programs applet.

The second text file (which you need to create) can have an arbitrarily chosen name; for example, c:\comp.txt will do nicely. This file can be created using Notepad and should contain the [Components] section, followed by one or more lines of the following format:

Component_Name = On/Off

Here, On is used for installation and Off is used for uninstallation. For example, to remove Windows Messenger and add Faxing, the file should contain the following lines:

[Components]
Msmsgs=Off
Fax=On

You can also install optional networking components by including the line Netoc=On and the additional section [NetOptionalComponents]. This section would contain lines that refer to different networking components, such as SimpTcp or wins, like so:

SimpTcp=1
wins=1

A value of 1 causes installation and 0 causes uninstallation. The names of the components are the same as the ones used during unattended installation of the operating system, which are documented in the Unattended.doc file on the Windows installation CD in the Support\Tools folder.


O'Reilly Home | Privacy Policy

© 2007 O'Reilly Media, Inc.
Website: | Customer Service: | Book issues:

All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners.