Recipe2.14.Configuring System Startup Options


Recipe 2.14. Configuring System Startup Options

Problem

You want to configure the system startup options for a server.

Solution

Using a graphical user interface

  1. From the Control Panel, open the System applet.

  2. Select the Advanced tab.

  3. Under Startup and Recovery, click the Settings button.

  4. Under the System Startup heading, you can modify the default operating system and the amount of time the system waits before loading the default OS.

  5. To change additional startup options on Windows Server 2003, you can click the Edit button to modify the boot.ini file. See the Discussion section for how to do this on Windows 2000.

  6. Click OK until all of the windows are closed.

Using a command-line interface

Windows Server 2003 includes a new tool called bootcfg.exe (also available with Windows XP) that lets you examine and modify the system startup options (including boot.ini) from the command line. To get a list of the current startup options, run bootcfg without any parameters:

> bootcfg

The following command changes the timeout setting for the default OS option to 15 seconds:

> bootcfg /timeout 15

The following command adds the /DEBUG and /SOS options to the OS option defined by ID 2 (which you can see by running bootcfg without any options):

> bootcfg /Raw "/DEBUG /SOS" /A /ID 2

For the complete list of bootcfg options, run bootcfg /? from the command line.

Using VBScript
' This code displays the system startup settings. ' ------ SCRIPT CONFIGURATION ------ strComputer = "."  ' e.g., rallen-srv01 ' ------ END CONFIGURATION --------- set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") set colCompSys = objWMI.InstancesOf("Win32_ComputerSystem") for Each objCompSys in colCompSys     WScript.Echo "Startup Delay: " & objCompSys.SystemStartupDelay     for each strOption in objCompSys.SystemStartupOptions        WScript.Echo "Operating System: " & strOption     next next     ' This code sets the startup delay to 10 seconds. ' ------ SCRIPT CONFIGURATION ------ strComputer = "."  ' e.g., rallen-srv01 ' ------ END CONFIGURATION --------- set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") set colCompSys = objWMI.InstancesOf("Win32_ComputerSystem") for Each objCompSys in colCompSys     WScript.Echo "Startup Delay Before: " & objCompSys.SystemStartupDelay     objCompSys.SystemStartupDelay = 10     objCompSys.Put_     WScript.Echo "Startup Delay After: " & objCompSys.SystemStartupDelay next

Discussion

For a list of options that are supported in boot.ini, see MS KB 833721.

Using a graphical user interface

The Edit button is available only on Windows Server 2003. If you want to modify the boot.ini file on Windows 2000, you'll have to use the procedures described next in the command-line solution.

Using a command-line interface

Since Windows 2000 doesn't come with the bootcfg utility, you have to modify the boot.ini file directly. First, make the file editable:

> attrib %SystemDrive%\boot.ini -h -r -s

Then edit the file:

> edit %SystemDrive%\boot.ini

And finally, make the file read-only and hidden again:

> attrib %SystemDrive%\boot.ini +h +r +s

Using VBScript

None of the scripting interfaces support modifying the boot.ini file (aside from direct file manipulation).

See Also

MS KB 99743 (Purpose of the BOOT.INI File in Windows 2000 or Windows NT), MS KB 102873 (BOOT.INI and ARC Path Naming Conventions and Usage), MS KB 242443 (Boot Menu Is Not Displayed and Timeout Value Is Not Used), MS KB 291980 (A Discussion About the Bootcfg Command and Its Uses), and MS KB 316739 (How to Use the /USERVA Switch in the Boot.ini File to Tune /3GB Configurations)



Windows Server Cookbook
Windows Server Cookbook for Windows Server 2003 and Windows 2000
ISBN: 0596006330
EAN: 2147483647
Year: 2006
Pages: 380
Authors: Robbie Allen

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net