Skip to main content.

Understanding the goal: unattend.txt

Windows Setup is the program which installs Windows on a new computer. To do this, it needs to ask lots of questions: What is your name? What is your product key? What is your time zone? And so on.

When you install Windows by hand, Windows Setup will stop and put up a dialog box for every question to which it needs an answer.

To perform an unattended installation, we need to provide an "answer file" with pre-recorded answers to all of the questions. The traditional name for this file is unattend.txt, and its creation is our main goal. Another way of describing the overall unattended installation process is:

  1. Obtain access to the OS installation media
  2. Obtain access to the destination hard drive
  3. Generate unattend.txt
  4. Run Windows Setup with appropriate switches to make it get answers from unattend.txt instead of dialog boxes

These are the steps which Unattended automates. It uses DOS to provide access to the OS installation media and hard drive; it uses a Perl script to create the unattend.txt file; and it knows how to invoke Windows Setup appropriately.

You do not need to understand the contents of unattend.txt to use Unattended, but you should learn about it eventually anyway.

Syntax of unattend.txt

The general syntax of an answer file is the same as any .ini (or .inf) file. It looks something like this:



That is, it consists of sections, each headed by a section name in square brackets. Each section has zero or more entries (also called settings). Each entry assigns a value to a key, or else consists of a key by itself. Any line beginning with a semicolon, or whitespace followed by a semicolon, is a comment.

If the value contains any special characters, or if it is the empty string, it must be placed in quotation marks. Which characters qualify as "special" is undocumented; the .ini file parser/generator in Unattended tries to be fairly conservative, and will exit with an error message if it encounters an unrecognized line. Quotes are allowed even when they are not required, so when in doubt, use them.

For a complete sample unattend.txt file, use Unattended to install Windows and then examine C:\NETINST\UNATTEND.TXT. For a partial file containing some of Unattended's defaults, see Z:\lib\unattend.txt from the distribution.

Microsoft's documentation

The most thorough documentation for the answer file is Microsoft's own, but unfortunately, it is a bit annoying to obtain. There are different versions for Windows 2000 and Windows XP, although the answer files are very similar.

Windows 2000 Guide to Unattended Setup
Microsoft put the SP1 version of this document on the Web, but they seem to have stopped with later service packs. The canonical way to obtain this document is to download and install the Windows 2000 SP4 Support Tools, then use Internet Explorer to extract the unattend.doc file from the archive.

You can also find an earlier version of on the Windows 2000 CD in the \support\tools folder.

Microsoft Windows Preinstallation Reference
As far as we know, this document is not available directly on the Web. You must first download the Windows XP SP1a Corporate Deployment Tools, Then use Internet Explorer to extract ref.chm, a a Windows "Compiled Help" file, which you can double-click to browse.

Here again, may also be found on the Windows XP CD in the \support\tools folder.

Windows Server 2003
For Windows Server 2003, Unattended Installation Tools and Settings Seems to be the document.