Deploying Windows 2000 Using Answer Files
Answer files are one of the best-named files in world of Windows 2000. They look like classic INI files and do exactly what their name implies; they answer the setup program's questions on behalf of the user. The result is an automated Windows 2000 installation. The level of automation is up to you, and can range from providing one value for the user to providing everything.
The easiest way to create an answer file is using Setup Manager (Setupmgr.exe). This program comes with the Windows 2000 Resource Kit. Run Setup Manager and fill in the prompts, and it saves the results to a file called Unattend.txt. You'll usually want to follow this up with a look at the file in Notepad, though, just to ensure that all the settings are what you expect. For that matter, you can create answer files from scratch using Notepad and the example you see in Listing 1. If you are creating answer files from scratch, you'll want to print Unattend.doc and keep it handy. Unattend.doc also comes with the Resource Kit.
Once you've created the answer file, you add it to the setup program's command line. The setup program will use the responses from the file instead of prompting the user. Winnt /s:<source> /u:<unattend> is the command line for running the setup program from MS-DOS. <source> is the path containing the Windows 2000 source files—\\server\w2k\i386, for example. <source> is the path and filename of the answer file—\\server\w2k\unattend.txt. The command line you'd use from Windows is Winnt32 /s:<source> /u:<unattend>.
Listing 1 is an example answer file, one that I frequently use to install Windows 2000 and join the computer to a domain. Here are the highlights of this file:
-
By not providing a user name or computer name in the [UserData] section, I'm causing the setup program to prompt users for both bits. Filling in user name and computer name isn't possible, since I don't want to duplicate the same names on the network.
-
UnattendMode = "ReadOnly" ensures that users can't change values that you specify in the answer file. Also, the setup program skips any dialog box that you've completely answered using the answer file.
-
The [Identification] section joins the computer to a domain. Because an account and password aren't specified, the setup program prompts the user for the credentials of a user who has the rights necessary to join computers to the domain. This is typically the domain administrator, unless you delegate users full control over their machine accounts (the best practice for this situation).
-
The [Networking] section is by far my favorite. One item, InstallDefaultComponents = "Yes", is all you must specify in order to configure the computer for a Microsoft-based network. This assumes that you've properly configured a DHCP server to give client computers their IP addresses, DNS/WINS server addresses, etc.
For most purposes, the answer file in Listing 1 works well. It's almost completely automated, except for two prompts. The first is for the password of the local administrator account—nothing much you can do about this prompt except to set the local administrator's password to blank. The second is for the credentials necessary to join the computer to the domain. Again, you can rely on a user's own credentials by delegating full control over the machine object to him or her.
Listing 1
[UserData] OrgName = "Jerry Honeycutt" ProductID = "99999-99999-99999-99999-99999" [Unattended] FileSystem = "ConvertNTFS" OemSkipEula = "Yes" UnattendMode = "ReadOnly" [GuiUnattended] OEMSkipRegional = "1" OEMSkipWelcome = "1" TimeZone = "020" [Display] BitsPerPel = "16" Xresolution = "1024" Yresolution = "768" [TapiLocation] AreaCode = "972" CountryCode = "1" Dialing = "Tone" [Identification] JoinDomain = "HONEYCUTT" [Networking] InstallDefaultComponents = "Yes"
Answer files form the basis for every Windows 2000 deployment method. If you're using disk duplication, you'll still have an answer file (actually, you'll have two). If you're using RIS, you'll still have an answer file. Given their ubiquity, answer files are worth investigating more. Microsoft has many resources for learning more, but the best is Unattend.doc, which comes with the Windows 2000 Resource Kit.
Next, I'm going to show you useful things you can do with answer files. Call them stupid answer-file tricks if you like, but you'll learn how to distribute files with Windows 2000, run other programs during the setup process, or change installation directories.
About the Author
As a best-selling author, Jerry Honeycutt has written over 25 books. His most recent include Windows 2000 Professional (New Riders, 2000), Microsoft Windows 2000 Registry Handbook (Que, 2000), and Introducing Microsoft Windows 2000 Professional (Microsoft, 1999). Most of his books are sold internationally and are available in a variety of languages. Jerry is also a columnist for Earthweb, and writes feature articles for various trade and consumer magazines, such as Smart Business and CNET.
Jerry is a frequent speaker at assorted public events, including COMDEX and Developer Days, and occasionally hosts chats on Microsoft's TechNet Web site. He is currently presenting the Microsoft-sponsored seminar, "Business Desktop Deployment" to IT professionals around the world.