The Windows Learning Center

How to Use and Edit Boot.ini in Windows XP

Boot.ini is an important system file with crucial boot functions. Here we discuss what it does and how to edit it.

Function and Purpose of Boot.ini

Boot.ini is one of the very first files that come into play when a Windows XP system is started up. It is a plain text file that is kept in the system root, so it is usually C:\boot.ini. Because it is an essential system file, the attributes are set to hidden, system, read-only to protect it. That means that it will not appear in the file lists in My Computer or Windows Explorer unless the default Windows settings are changed to show hidden files.

Boot.ini contains the location of the Windows XP operating system on the computer. If there is a multi-boot system, the locations of of any other operating systems are also contained. During the startup process, functions from the Windows XP file named "Ntldr" are in charge of getting the proper operating system loaded and Ntldr looks at boot.ini to find out where the operating systems are located and whether a menu should be displayed. Boot.ini can also include entries giving boot options such as Safe Mode or the Recovery Console.

Note that if you are dual-booting with Windows Vista or 7, the boot process is different from that described here and boot.ini is not present.

Boot Menus

If more than one option is available in boot.ini, a menu will be displayed at boot up listing the choices. An example of the boot menu for a dual-boot system with the added option of Safe Mode in Windows XP is shown below. These entries are determined by the contents of boot.ini.

Example of a boot display menu
Please select the operating system to start:


   Microsoft Windows XP Professional
   Safe Mode
   Microsoft Windows Me


Use the up and down arrow keys to move the highlight to your choice.
Press ENTER to choose.
Seconds until highlighted choice will be started automatically: 26      

For troubleshooting and advanced startup options for Windows, press F8.

Structure and Contents of Boot.ini Files

Some examples of boot.ini files are given in the table below. There are two sections in a boot.ini file. The first is [boot loader], which contains two settings that apply in general. The entry "timeout={ some decimal number}" is the time in seconds that the system waits before it loads the default operating system. This is set to 30 unless you make a change. The default system is determined by the next line "default={address of operating system} For most home PCs the entry is "default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS".

The entry is used by Ntldr to find where the Windows operating system is located. The rather complicated-looking default line provides for advanced hardware options that are not common in home setups. (It is called the Advanced RISC Computing or ARC naming convention.) The most likely part that a home user might change is the partition number for systems where a dual-boot system is being used. Normally, a proper installation will make the necessary entries for the default and it is rare that any editing of the disk or partition numbers would be required. In multi-boot systems it is sometimes desirable to switch which operating system is the default but that is easily accomplished by methods discussed in the section on editing below.

The second section of a boot.ini file is [operating systems]. It contains a list of the operating systems and bootable programs and where they are located. It can also include switches that configure a particular operating system or program.

The names that appear in the boot display menu are taken from this section. The display names are those that are enclosed in quotation marks following an equals sign. The table below will help clarify the contents of boot.ini.

Some examples of boot.ini files
A typical simple example [boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect
Example with Recovery Console as an option [boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect
C:\CMDCONS\BOOTSECT.DAT="Microsoft Windows Recovery Console" /cmdcons
Example of a dual-boot system with XP on partition 2. Note that the location of Windows Me is given as C:\ [boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(2)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Microsoft Windows XP Professional" /fastdetect
C:\ = "Microsoft Windows Me "
Example with Safe Mode as an option and "timeout" =10 seconds [boot loader]
timeout=10
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Safe Mode" /safeboot:minimal /sos /bootlog

How to Edit Boot.ini Files

Since boot.ini is a text file, it can be edited with a text editor such as Notepad. However, the attributes must first be changed, Also, care must be taken to preserve the correct extension. Since any mistakes in editing might very well render your system unbootable, it is better to use one of the safer methods that are available. Before using any method, be sure to make a backup copy.

One of the most common reasons for editing boot.ini is to reduce the "timeout" setting in order to speed up booting. This is easily accomplished by using the System Configuration Utility (often called msconfig). Open Start-Run and enter "msconfig". The box shown below will open.

Using Msconfig to edit Boot.ini

Click the tab "BOOT.INI" and the figure shown next will open. The contents of the boot.ini file are shown and a number of configuration settings are available. In the middle right is a box where the settings for Timeout can be changed. This example is for a dual-boot system and another common reason for editing is to change the default operating system in dual-boot setups. Note that there is a button "Set a Default" as well as buttons "Move Up" and "Move Down" (grayed out here). If there are multiple entries in the boot display, their order can be rearranged here. There are also a number of advanced options that experienced computer users may look at. These other functions are discussed in the Microsoft references given at the end of the article.

Editing Boot.ini

Another way to configure these two most commonly edited settings is to open the Start menu, right-click on "My Computer" and choose "Properties" from the context menu. The System Properties dialog box will open as shown below. In the section "Startup and Recovery" click the button "Settings".

Using System Properties dialog to edit

The dialog box shown in the next figure will open. Both the Timeout setting and the default operating system can be changed here.

Startup and Recovery dialog

To add or delete an operating system or program from the boot display menu, use the "Edit" button on the right of the entry "To edit the startup options file manually, click Edit" as shown in the figure below. For example, if it is no longer desired to dual-boot a system, the unwanted operating system can be removed from the boot display menu this way.

System startup dialog

The command line tool bootcfg.exe

Windows XP Professional also has a command line utility for manipulating boot.ini called bootcfg.exe. (It may or may not be in a Home Edition installation.) It is described in this Microsoft reference. It can be used in the Recovery Console to repair a damaged boot.ini file or in a command window to edit entries to the file. There are a number of different switches and these are illustrated in the output to a command window shown below.

Syntax and switches for command-line use of Bootcfg.exe

There is another set of switches for bootcfg when it is being run in the recovery console. These are discussed at this Microsoft reference. A discussion of using the tool to repair a damaged setup is discussed here. For example, a damaged boot.ini file can be scanned or deleted and a new version built.

Addition of DEP switch in Windows XP SP2

The security updates in service pack 2 for Windows XP included the addition of capability for DEP (Data Execution Prevention). DEP configuration for the system is controlled through switches in the boot.ini file. Some features of DEP are turned on by default with a boot.ini switch "/NoExecute=OptIn". There are three other possible values for this switch and they are discussed on another page. Typical entries in boot.ini for a Windows XP SP2 system are shown in the table below.

Simple boot.ini for a Windows XP SP2 system
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect /NoExecute=OptIn

Most current processors can use DEP although some older systems may not. There have been some reports that these older systems can be slowed down if DEP is enabled. More details on configuring the settings for DEP are given on a separate page.

Note about Windows Vista and Windows 7

It should be noted that Windows Vista/7 uses a different way of managing the boot process. There is no longer a text file called boot.ini. Boot information is stored in a Registry-like file called the Boot Configuration Data (BCD) store. Extensive information on the new boot process can be found at this Microsoft site. Windows Vista/7 comes with a command-line tool bcdedit.com for configuring BCD.

Microsoft references