Chapter 10 - Windows NT 4.0 Automated Installation Framework
Archived content. No warranty is made as to technical accuracy. Content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
By Matthew D. Storer, Microsoft Consulting Services, Great Lakes
AT A GLANCE
Key Point: Microsoft Consulting Services developed the Windows NT 4.0 Automated Installation Framework (MSIF)—a collection of components that make PC installation and configuration automatic and dynamic—to provide a quick sample implementation.
Detail: High Task: Installing, Deploying
Article Section |
What's There |
---|---|
Hands-On Installation |
Describes how large deployments and sophisticated operating systems have made hands-on installations a thing of the past. |
Windows NT 4.0 Automated Installation Framework (MSIF) |
Explains the components and steps used in MSIF. |
Setup and Configuration |
Details steps in the MSIF framework, including selecting an image server and create a network share from which the entire installation is performed, copying the Windows NT 4.0 operating system (Workstation or Server) to the share, and installing the MSIF framework. |
Component Architecture |
Describes the process and each of the steps in detail. |
File Samples |
Code samples from several files. |
Quick Reference for Unattended Installation |
Summarizes tools and methods created by MCS. |
There are a number of tools and methods for building an automated Microsoft Windows NT 4.0 installation and most of them are clearly documented in the MS Windows NT Workstation Deployment Guide - Automating Windows NT Setup and the Automating Windows NT Setup Deployment Guide Supplement, both of which are available on TechNet. These guides require a deep knowledge Windows NT 4.0 setup files, which can sometimes intimidate technical managers and engineers.
Microsoft Consulting Services (MCS) has developed a framework called the Windows NT 4.0 Automated Installation Framework (MSIF)—a collection of components that make PC installation and configuration automatic and dynamic—to provide a quick sample implementation based on standard practices outlined in the deployment guide and MCS deployment experience.
The Customizing the Windows NT 4.0 Upgrade Process framework (also available on TechNet) focuses on building and managing complex automated upgrades.
Warning: This article makes recommendations for tuning the Windows NT registry using the Registry Editor. Using the Registry Editor incorrectly can cause serious, system-wide problems that require you to reinstall Windows NT. Microsoft cannot guarantee that any problems resulting from the use of Registry Editor can be solved. Use this tool at your own risk.
On This Page
Hands-On Installation
Windows NT 4.0 Automated Installation Framework (MSIF)
Setup and Configuration
Component Architecture
File Samples
Quick Reference for Unattended Installation
Hands-On Installation
Today, large deployment-project rollout schedules often require many Windows NT installations and upgrades to be completed per day, so many that the hands-on approach, which takes hours of dedicated technician time and introduces more chances for mistakes, is neither feasible nor economical.
Hands-on installation traditionally has involved copying an image from hard disk to hard disk or over the network. As operating systems have become more sophisticated, utilities have been created to take an image from one hard drive to another by copying sectors. A hard drive duplication installation of Windows NT presents two issues: the impact of the hardware it is installed on, and the need for a unique Security ID (SID) in each instance of the operating system so that all Windows NT operating systems can communicate. The second condition requires each computer to have a unique Windows NT installation for proper support and operation. In sum, you need an easier and more efficient method.
Windows NT 4.0 Automated Installation Framework (MSIF)
The Microsoft Windows NT 4.0 Automated Installation Framework (MSIF) is a collection of components that work together to install and configure computers automatically. The components are installed independent of each other, which gives you flexibility at each stage of the process: installing the operating system, configuring, and installing applications. This design also reduces overall implementation costs by reusing previously developed installation components.
Although simple, MSIF objectives require enterprise participation to be successful: you have to plan and develop your solution using the MSIF specifications. MSIF is a framework; it requires standard installation practices, and installation and configuration documentation, but it offers fast installation and configuration.
The process is sequential and simple. Create a share point on an image server, copy a Windows NT 4.0 Workstation or Server image to the share point, install the sample MSIF components to the share point, modify the components, and independently automate each application installation. Then all you have to do is insert the modified boot disk and start the installation.
A framework installation involves five stages (explained more fully below):
Boot disk and configure hard drive
Windows NT operating system installation
Windows NT configuration and application installation
Technician configuration
Quality assurance
Boot Disk and Configure Hard Drive
The boot disk addresses the installations first action item—"reformatting" the hard drive and loading the appropriate network drivers. After the network drivers are loaded, the boot disk connects to the MSIF share point and downloads a set of MSIF script files created for the system (the computer hardware/software combination) being installed.
Windows NT Operating System Installation
The boot disk then starts the Windows NT operating system installation using standard unattended command line parameters. Near the end of Windows NT setup, an MSIF script file is executed that forces Windows NT to automatically log on after reboot, bypass Windows NT Tip of the Day, and begin running each application installation sequentially.
Windows NT Configuration and Application Installation
After Windows NT setup completes and reboots, MSIF runs the application installation in two phases separated by an operating system reboot. This makes it possible to install applications that require a reboot before they can be configured. The last step of the MSIF framework removes all of the MSIF automated programming changes.
Technician Configuration
Although the system has been automatically installed and configured, you still may have to perform several steps by hand. Technicians may be needed to create an Emergency Repair disk, or perform other tasks that cannot be automated.
Quality Assurance
Now that the machine has been completely set up, you need to test it to ensure that all of the bits have been copied and installed correctly. All or part of this testing can be automated, but if it is done by a technician, try to draw QA testers from groups other than the configuration team, whose members are too involved with the implementation to test it objectively.
Setup and Configuration
The first step to setting up the MSIF framework is to select an image server and create a network share from which the entire installation is performed. Next, copy the Windows NT 4.0 operating system (Workstation or Server) to the share. Then install the MSIF framework. Finally, update the MSIF boot disk with the appropriate network driver and the MSIF template scripts customized. These steps are explained in greater detail below.
Required Materials
You need a server with ample disk space and network connectivity, any licensed copy of Windows NT 4.0, the MSIF boot disk, and an image of each application that needs to be installed.
Step 1: Create Image Server Share Point
The image server is a critical MSIF framework component.
Optimization Suggestions
Here are some suggestions to optimize the mass installation process:
To minimize connectivity problems, the server should be a Windows NT Server 3.51 or higher.
To maximize throughput, use high-speed network adapters and hubs/switches.
To utilize available physical network bandwidth, install the server on an isolated network segment or at least on a dedicated routed network segment.
To get the best Windows NT performance, select System Properties from Control Panel and configure the server for Average Boost. Then from Control Panel, select Network then Services, and configure the server for File and Print.
To reduce access to the server during production loads, use the image server only for production loads—not for testing, general file sharing, or even as an application server.
To reduce the number of files copied during Windows NT setup, you can remove some directories. For example, once you have identified which network interface cards (NICs) you need to load, you can delete all of the NICs that you do not need. They are listed under the I386\DRVLIB.NIC.
Required Steps
From the Windows NT Explorer, create a directory called MSIF.
Share the directory as MSIF.
Set appropriate permissions on directory and share.
Step 2: Copy Windows NT Image to Share Point
After you have created the share point, copy a subset of the Windows NT operating system source files into it. In addition to the standard Windows NT installation files, this directory will also host various unattended files such as CMDLINES.TXT and other third party OEM video and network drivers as described in Microsoft Windows NT Workstation: Deployment Guide. The example framework provided also includes a "co-installation" of a Windows NT service pack. When copying files, make sure that you are actually copying all files (some Windows Explorer views "hide" DLL and SYS files.)
Required Steps
From the root of the share point, create a directory called NT4WKS for Windows NT 4.0 Workstation or NT4SRV for Windows NT 4.0 Server.
From the Windows NT 4.0 source, copy the entire I386 directory to either NT4WKS (workstation) or NT4SRV (server).
From the root of the share point, create a directory called NT4SP3 (or the latest Windows NT service pack version) for Windows NT 4.0 Service Pack 3.
From the Windows NT 4.0 Service Pack 3 source, copy the entire set of files to the NT4SP3 directory.
Step 3: Install MSIF Framework
After you have copied the Windows NT source files to the image server, run SETUP.BAT from the SETUP directory on the MSIF boot disk, found on the Supplemental Drivers and Patches CD. This file creates the $OEM$ directory in the NT4WKS\I386 and NT4SRV\I386 directories, copies the standard MSIF CMDLINES.TXT into the $OEM$ and $$ directories, moves the Windows NT service pack (if one is found) to the $$ directory, creates the TEMPLATES directory in the root of the share point, and copies MSIF sample scripts into the TEMPLATES directory.
Required Step
- From the MSIF boot disk SETUP directory, run SETUP.BAT [drive:], where [drive:] is the drive letter mapped to the share point. At a minimum, SETUP.BAT requires that NT4WKS or NT4SRV exist under the root of the MSIF share and that you have placed the Windows NT service pack in NT4SPx (where x is the version number of the service pack).
Step 4: Customize MSIF Framework
When you have installed the MSIF framework and copied the Windows NT operating system files to the share point, you need to customize the MSIF boot disk and sample scripts. This generally requires three customizations: rebuild the disk partition, customize the template, and add support for network drivers.
Required Steps: Rebuild Disk Partition
Most hard drives require modification to support a network-based unattended installation of Windows NT 4.0. The disk partition can be configured in a variety of ways and the number of steps and tools used to accomplish this vary from deployment to deployment. The three most common reasons a hard drive requires repartitioning:
It has Windows 95 FAT32 file system installed, which cannot be accessed by Windows NT 4.0.
Its partitioning scheme is not desirable. For example, a standard configuration may require a 1-GB logical C drive.
It does not have any partition information, so the primary partition needs to be created from scratch.
Because you will most likely have to modify the sample boot disk provided, here are several methods to automate the creation of new partitions and logical disk drives.
DEBUG.EXE with Input Test File
You can use this command to turn a hard drive into a totally raw disk. It should work on any machine with any types or numbers of partitions. The DEBUG script was taken from the Microsoft Developer Network. (For more information on it, search on debug partition table in the MSDN Knowledge Base.) The sample framework uses this command in conjunction with FDISK.EXE 1 /PRI:500 /Q. The contents of DELPART.TXT are shown in the Component Architecture section.
Command Line:
DEBUG.EXE < DELPART.TXT
FDISK.EXE with Unsupported Command Line Parameters
You can use this command to create a new primary partition of a specific size. The switches listed below can simplify the unattended load process, but Microsoft does directly not support them. The sample framework uses this command in conjunction with DEBUG.EXE < A:\DELPART.TXT. The FDISK command is detailed under AUTOEXEC.BAT in the "Boot Disk/Hard Drive MSIF Files" subsection of the File Samples section.
Command Line:
FDISK 1 /PRI:<size in MB> /Q (to create a primary partition) FDISK 1 /EXT:<size in MB> /Q (to create an extended partition) FDISK 1 /LOG:<size in MB> /Q (to create a logical drive)
FDISK.EXE with Input Text File
You can create one or more input answer files to delete existing partition information and create new ones. When you create new partitions, remember to set the primary partition as active.
Command Line:
FDISK.EXE < FDISK.TXT
Required Steps: Add Custom Template
Templates determine which set of MSIF installation scripts to run.
To prepare a new template, create a new directory under TEMPLATE on the image server share point. Give it a name that uniquely identifies it and is no longer than eight characters. This is the name used as the TEMPLATE value in the MSIF boot disk process.
Copy the template scripts from the TEMPLATES\SAMPLE directory to the new directory. Customize a copy of them so that you can keep an original version.
Open AUTOEXEC.BAT located in the root of the MSIF boot disk and locate the "ECHO MSIF Configuration Template Menu:" line. Using the example provided and the name of the new template directory, update the sample or add your choice. Then add or update the "if "%OPTION%" == "1 "SET TEMPLATE=CPQ5200A" statement substituting the correct OPTION number and template name.
Figure 1 Example MSIF boot disk AUTOEXEC.BAT file: where to place custom template
Required Steps: Add Network Adapter Card Driver
The boot disk stores all of the necessary files for MS-DOS networking under A:\NET. It uses NetBEUI as the network protocol and stores each NIC driver, PROTOCOL.INI, and SYSTEM.INI, in a unique subdirectory of A:\NET identified by the name of the MSIF template. The sample boot disk provided uses an NE2000-compatible MS-DOS network driver.
To add a new NIC to the boot disk is simple.
To use the NE2000 with NetBEUI:
Locate the root of A:\NET directory.
Change the name of the sample CPQ5200A to the name of your template.
To use a different NIC with NetBEUI:
Locate the root of A:\NET directory.
Change the name of the sample CPQ5200A (or create a new directory) to the name of your template, which is the name you assigned during the "Add Custom Template" step above.
Copy the MS-DOS NIC driver, SYSTEM.INI, and PROTOCOL.INI to the new template directory. If you do not have a SYSTEM.INI or PROTOCOL.INI, use the sample ones and edit the driver name.
To use a different NIC and protocol such as Transmission Control Protocol/Internet Protocol (TCP/IP):
Create a new network boot disk from scratch using the NCADMIN.EXE tool that ships with Windows NT Server 4.0.
Copy all of the files in the root of the MSIF sample disk to the root of the new boot disk. DO NOT COPY A:\NET subdirectory.
On the new boot disk, locate the root of A:\NET directory.
Create a new subdirectory using the new template name (the name you assigned during the "Add Custom Template" step above).
Move the MS-DOS NIC driver, SYSTEM.INI, and PROTOCOL.INI from the root of the A:\NET directory to the new template directory.
Edit the relocated SYSTEM.INI. Delete the values to the right of these entries:
computername=
username=
workgroup=
logondomain=
Component Architecture
The flowchart in Figure 2 graphically represents the MSIF process. The rest of this section describes each of the steps, or components, in detail.
Figure 2 The MSIF process
Boot Disk/Configure Hard Disk
The MSIF boot disk is used to boot up MS-DOS 6.22 operating on the target computer, create new disk partition, format the new partition, load network drivers and connect to the MSIF share point, and finally, start the installation of Windows NT. If you don't have to reconfigure the partition schema on your computer you can skip steps 1 and 2 below.
Process
The sample MSIF boot disk functions as if the Windows NT operating system will be installed in drive C, which needs to be recreated (re-partitioned). The boot disk goes through the following process:
1. MS-DOS Boot
The boot disk loads MS-DOS 6.22 operating system, HIMEM.SYS, EMM386.EXE, and IFSHLP.SYS (see the "File Samples" section below). The batch file AUTOEXEC.BAT is executed from the boot disk.
2. Determine Boot Status
This section tracks the installation progress so that the system can be rebooted at desired intervals. It stores the state of the STATUS environment variable in A:\STATUS.BAT as one of three values: STEP1, STEP2, or BYPASS. A GOTO statement is used to run the corresponding step established by the STATUS variable. Below is a sample of the commands used. The first line defaults STATUS to equal STEP1 in the case that the STATUS.BAT has been deleted. (These STEPS are part of the framework; you can modify them to suit your needs.)
SET STATUS=STEP1 IF EXIST A:\STATUS.BAT CALL A:\STATUS.BAT CLS @ECHO. @ECHO Window NT 4.0 Automated Installation Framework @ECHO Boot Disk - %STATUS%, Revision 4.0 @ECHO ---------------------------------------------------------- @ECHO. IF %STATUS%==STEP2 GOTO STEP2 IF %STATUS%==BYPASS GOTO BYPASS GOTO STEP1
3. STEP1—Prompt for Information
This section prompts you to select an MSIF Template. This menu allows you to run more than one system configuration from the same boot disk and network share point. If you want, you can comment out the menu and set the template to a default. The command line tool ENQUIRE.COM is free utility used to prompt for user input and set value to an environment variable, such as OPTION. The OPTION variable uses a series of "if" statements to determine which MSIF template to invoke.
After the variant information has been collected, the environment variables are saved to a file named VARS.BAT to be used during STEP2. For this boot disk these environment variables are set:
TEMPLATE = The MSIF unique name assigned to a particular computer configuration
COMPUTERNAME = The computer name used by the boot disk when starting the network services and the computer name assigned to the Windows NT computer
REM 1. Prompt for Information.
ECHO. ECHO MSIF Configuration Template Menu: ECHO. ECHO 1) Compaq LTE 5200 (CPQ5200A) ECHO 2) Dell OptiPlex GXa (DELLA) ECHO 3) Boot to DOS ECHO. ENQUIRE "Enter choice (1, 2, or 3) = ", OPTION if "%OPTION%" == "1" SET TEMPLATE=CPQ5200A if "%OPTION%" == "2" SET TEMPLATE=DELLA if "%OPTION%" == "3" GOTO END ECHO. ENQUIRE "Enter name of computer = ", COMPUTERNAME ECHO. ECHO SET TEMPLATE=%TEMPLATE%> A:\VARS.BAT ECHO SET COMPUTERNAME=%COMPUTERNAME%>> A:\VARS.BAT ECHO SET LOGIN=install>> A:\VARS.BAT ECHO SET PASSWORD=install>> A:\VARS.BAT ECHO SET WORKGROUP=usa-detroit>> A:\VARS.BAT ECHO SET DOMAIN=loadsite>> A:\VARS.BAT ECHO SET NETDRIVE=x:>> A:\VARS.BAT ECHO SET NETSERVER=MSTORER_TRP>> A:\VARS.BAT ECHO SET NETSHARE=MSIF>> A:\VARS.BAT
4. STEP1—Rebuild Disk Partition
This section runs DEBUG.EXE to delete the pre-existing MS-DOS or non-MS-DOS partitions and it creates a new small FAT16 MS-DOS partition using the undocumented FDISK 1 /PRI:500 command. The small partition size speeds up the initial format. Windows NT extends the partition size to its fullest potential during its load. If you want the size of drive C to remain fixed, remove the entry "ExtendOEMPartition" from UNATTEND.TXT located under the TEMPLATE directories.
DEBUG.EXE, uses an MSDN documented input text file to "wipe" the disk
FDISK.EXE, creates new primary MS-DOS partition (500 MB)
For more information, see the "Required Steps: Rebuild Disk Partition" section.
REM 2. Rebuild Disk Partition. ECHO SET STATUS=STEP2 > A:\STATUS.BAT a:\debug.exe < a:\delpart.txt a:\fdisk.exe 1 /PRI:500 /Q a:\reboot.com
4. STEP2—Format Disk
Begin step 2 by formatting the hard disk using the standard command line switches available and an input text file that simply contains the character y. This is used to respond to the question, "Do you want to continue?". /U indicates unconditional format and /V sets the volume name. FORMAT.TXT contains the string Y. Below is a sample of the command used:
ECHO 1. Formating Hard Drive...
a:\format C: /U /V:CORP < a:\format.txt
5. STEP2—Set Status Bypass Flag
The STATUS flag is set to BYPASS in the event that a technician needs to cancel the installation at this point. If STATUS=BYPASS on boot, AUTOEXEC.BAT bypasses disk partitioning and formatting. This is also handy for testing and troubleshooting.
ECHO 2. Setting BYPASS Flag... ECHO SET STATUS=BYPASS > A:\STATUS.BAT :BYPASS
6. STEP2—Load SmartDrive
SmartDrive optimizes memory allocation.
ECHO 3. Loading SmartDrive... a:\net\smartdrv.exe /x 2048 > nul
7. STEP2—Set Environment Variables Stored in VARS.BAT
Using the values written to VARS.BAT earlier, the boot disk executes VARS.BAT to "set" the environment variables. This allows variables to be collected initially and used later.
ECHO 4. Setting Environment Variables Stored in VARS.BAT... CALL A:\VARS.BAT
8. STEP2—Load Network Based on Selected Template
This copies the network adapter associated with the selected MSIF template to the A:\NET directory and updates the "clean" version of the network-adapter-specific SYSTEM.INI file with the environment variables. Note that this process looks for computername, logondomain, username, and workgroup to modify them. CHANGE.EXE is used to update the computer name in the boot disk SYSTEM.INI and in the UNATTEND.TXT file.
ECHO 5. Loading %TEMPLATE%... copy a:\net\%TEMPLATE%\*.* a:\net change a:\net\system.ini computername= computername=%COMPUTERNAME% > nul change a:\net\system.ini logondomain= logondomain=%DOMAIN% > nul change a:\net\system.ini username= username=%LOGIN% > nul change a:\net\system.ini workgroup= workgroup=%workgroup% > nul path=a:\;a:\net
9. STEP2—Start Network
This starts the network by logging on and then connecting to the MSIF network share.
ECHO 6. Starting Network... a:\net\net logon %LOGIN% %PASSWORD% /YES /SAVEPW:NO a:\net\net use %NETDRIVE% \\%NETSERVER%\%NETSHARE%
10. STEP2—Copying MSIF Template Files and Edit UNATTEND.TXT
From the connected MSIF network share, this copies down MSIF template files such as UNATTEND.TXT, INSTALL.BAT, RUNONCE.INF, etc., and updates the local copy of the UNATTEND.TXT with the new COMPUTERNAME entered earlier.
ECHO 7. Downloading MSIF Template Files... C: cd \ md msif copy %NETDRIVE%\TEMPLATE\%TEMPLATE%\*.* c:\msif change c:\msif\unattend.txt ComputerName= ComputerName=%COMPUTERNAME% > nul
11. STEP2—Reset Status Flag
This resets the MSIF boot disk by setting the STATUS flag file equal to STEP1. Before Windows NT installation starts, the STATUS variable is set to STEP1, which in effect "resets" the boot disk to be reused on another machine. If the boot disk gets "out-of-step," then delete A:\STATUS.BAT. This resets the boot disk manually.
ECHO 8. Resetting MSIF Boot Disk...... ECHO SET STATUS=STEP1 > A:\STATUS.BAT
12. STEP2—Start Windows NT Installation
This starts installing Windows NT by copying the INSTALL.BAT down from the image server. It contains the unattended call to start the installation of the specified operating system. More information on INSTALL.BAT is in the Component Architecture section.
ECHO 9. Starting Operating System Installation... c:\msif\install
Windows NT Operating System Installation
This phase of the installation (based mostly on the Automating Microsoft Windows NT Setup Deployment Guide) begins when the MSIF boot disk calls the C:\MSIF\INSTALL.BAT that was copied from the MSIF image server during the initial boot process. From this point, the standard unattended installation of Windows NT occurs, taking full advantage of the $OEM$\CMDLINES.TXT and RUNONCE.INF concepts. Most likely, you will not need to modify the script files used in this phase. System changes and application installation changes are covered in the next section—"Windows NT Configuration and Application Installation."
Figure 3 Process of Windows NT System Installation
Process
The MSIF boot disk calls the C:\MSIF\INSTALL.BAT, which starts the Windows NT setup using unattended-mode parameters to drive the installation. When the standard Windows NT installation is finished, the boot disk process checks for the existence of CMDLINES.TXT located in i386\$OEM$.
If it is found, Windows NT setup executes the commands listed in it. This framework uses CMDLINES.TXT to execute an .INF file called C:\MSIF\RUNONCE.INF, which forces auto-logon, changes the default Windows NT shell, and bypasses the Windows Tips.
1. INSTALL.BAT
INSTALL.BAT runs the Windows NT operating system installation in "unattended" mode. Specifically, C:\MSIF\INSTALL.BAT calls WINNT.EXE, the Windows NT setup executable. The standard Windows NT setup runs in unattended mode, reading all of its settings from the MSIF template file C:\MSIF\UNATTEND.TXT. Specifically, the "/u:C:\MSIF\Unattend.txt" component instructs Windows NT setup to run in unattended mode and to retrieve its settings from C:\MSIF\UNATTEND.TXT. The last component, "/s:X:\Nt4Wks\i386", simply complements the unattended mode by providing the source location of the Windows NT core operating system files (/s is required for a completely unattended mode).
X:\Nt4Wks\i386\WinNT /u:C:\MSIF\Unattend.txt /s:X:\Nt4Wks\i386
2. UNATTEND.TXT
The sample framework uses a generic UNATTEND.TXT file that includes most of the standard automated entries. For more information on how to customize this file, refer the Guide to Automating Windows NT Setup. UNATTEND.TXT is detailed in the "Windows NT Operating System Installation Files" section.
3. CMDLINES.TXT
Next, the content of CMDLINES.TXT is executed at the end of the standard Windows NT setup. This file is located in the i386\$OEM$ directory. The $OEM$ and CMDLINES.TXT are not installed automatically; MSIF installs them for you if you follow the steps in the "Setup and Configuration" section below. Windows NT runs CMDLINES.TXT before it reboots the last time. For purposes of this framework, CMDLINES.TXT was modified to call C:\MSIF\RUNONCE.INF and install the latest Windows NT service pack in silent mode.
[Commands] "rundll32 setupapi,InstallHinfSection DefaultInstall 128 C:\MSIF\RunOnce.inf" "C:\WINNT\NT4SP3\Update.exe -u -n -z"
4. RUNONCE.INF
Apply RUNONCE.INF to prepare Windows NT for continued configuration and application installation. RUNONCE.INF forces Windows NT to use both EXPLORER.EXE and PREBOOT.CMD as its shell, forces the system to auto-logon as Administrator with no password, and removes the default Windows NT Tips.
[AddReg] ; 1. Forces Windows NT shell from Explorer to be PREBOOT.CMD. HKLM, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", -> "Shell", 0, "Explorer.exe C:\MSIF\PreBoot.cmd" ; 2. Forces default user/password and enables autologon. HKLM, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", -> "DefaultUserName", 0, "Administrator" HKLM, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", -> "DefaultPassword", 0, "" HKLM, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", -> "AutoAdminLogon", , "1" ; 3. Disables default Windows NT Tips. HKCU, "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Tips", -> "DisplayInitialTipWindows", 65537, 0 HKCU, "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Tips", -> "Show", 1, 0, 0, 0, 0 HKCU, "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Tips", -> "Next", 1, 3, 0
Windows NT Configuration and Application Installation
This phase of the framework configures Windows NT 4.0 operating system and application installation. It is divided into two generic phases that replace the standard Windows NT Explorer shell—PreBoot and PostBoot. Figure 10.3 demonstrates the process flow.
Figure 4 Process for Windows NT configuration and application installation
Process
The Windows NT Explorer shell is replaced with PREBOOT.CMD by RUNONCE.INF (RUNONCE.INF is covered in the previous section.) PREBOOT.CMD connects to the MSIF share, downloads necessary utilities, launches scripted application installations, and re-sets Windows NT shell to POSTBOOT.CMD. The POSTBOOT.CMD connects to the MSIF share, launches scripted application installations, removes the MSIF connection, re-sets the Windows NT shell back to Windows NT Explorer, removes the autologon settings, and reboots.
PREBOOT.CMD
1. Set Environment Variables
The Pre-Reboot phase begins by setting environment variables that are used by this batch file and available to other installation scripts. As a part of this phase, C:\MSIF is added to the session path.
echo 1. Setting environment variables... SET MSIF_SHARE=\\MSTORER_TRP\MSIF SET MSIF_DRIVE=X: SET MSIF_SCRIPTS=C:\MSIF SET MSIF_LOGIN=install SET MSIF_PASSWORD=install SET MSIF_FULLNAME=Sample Installation SET MSIF_ORGNAME=Microsoft Consulting Services SET PATH=%PATH%;C:\MSIF
2. Connect to MSIF Share
After the variables are set, it connects to the MSIF share point. The error checking helps with troubleshooting slow connect times.
echo 2. Connecting to MSIF share point... :NETCONN NET USE %MSIF_DRIVE% %MSIF_SHARE% /USER:%MSIF_LOGIN% %MSIF_PASSWORD% IF ERRORLEVEL 1 Goto NetUseError Goto SkipNetUseError :NetUseError Echo Error connecting to image server! You may want to contact deployment support. Echo. Echo To retry connection, press ENTER. Echo To exit load, press CTRL+C. Pause GoTO NETCONN :SkipNetUseError
3. Download Utilities
Now that a network connection exists, MSIF downloads utilities located in the UTILITIES directory off of the root of the MSIF share, and copies them into C:\MSIF.
echo 3. Copying MSIF and other handy utilities to C:\MSIF... %MSIF_DRIVE% COPY \UTILITIES\*.* C:\MSIF
4. Set Windows NT Shell to Explorer
Next, PREBOOT.CMD sets the Windows NT shell back to Windows NT Explorer to reduce the possibility of getting errors during application installation.
echo 4. Setting Windows NT shell to Explorer... rundll32 setupapi,InstallHinfSection DefaultInstall 128 -> %MSIF_SCRIPTS%\Explorer.INF
5. Package Installations and Configurations
This is where you add your own scripted application installations. The example below uses the Microsoft Office 97 installation script as an example. The goal here is to abstract the framework from the detail programming of the actual installation script. So a batch file called OFF97ADM.BAT (meaning Office 97 Administrative installation) is used to "call" the Office 97 installation script located in OFF97ADM directory off of the root MSIF share. The SLEEP 5 allows each application script 5 seconds before starting the next one—this slows down the process and keeps the installation linear.
echo 5. Running Pre-Reboot package installations and configurations echo Office 97 Professional Edition %MSIF_DRIVE% CD \OFF97ADM CALL OFF97ADM.BAT SLEEP 5
6. Prepare System for Post-Reboot Phase
This step applies PREBOOT.INF changes, removes the network connection, and reboots the computer.
echo 6. Preparing system for Post-Reboot phase... rundll32 setupapi,InstallHinfSection DefaultInstall 128 -> %MSIF_SCRIPTS%\PreBoot.INF C: NET USE %MSIF_DRIVE% /D START SHUTDOWN.EXE /L /R /T:5 /Y
PREBOOT.INF changes the Windows NT shell to POSTBOOT.CMD, sets default logon user to Administrator, sets the default logon password to blank, and enables the AutoAdminLogon flag.
[AddReg] ; 1. Change Windows NT shell from PREBOOT.CMD to POSTBOOT.CMD HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", -> "Shell",0,"Explorer.exe C:\MSIF\PostBoot.cmd" ; 2. Forces default user / password and enables autologon HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", -> "DefaultUserName",0,"Administrator" HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", -> "DefaultPassword",0,"" HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", -> "AutoAdminLogon", ,"1"
POSTBOOT.CMD
This is phase 2 of the application installation and configuration section. Post-Reboot performs essentially the same processes as does Pre-Reboot, but it sets the Windows NT shell back to Windows NT Explorer and removes the autologon registry settings. This phase allows configuration of applications that require a reboot.
1. Set Environment Variables
The Post-Reboot phase begins by setting environment variables that are used by this batch file and are available to other installation scripts. As a part of this phase, C:\MSIF is added to the session path.
echo 1. Setting environment variables... SET MSIF_SHARE=\\[SERVER_NAME]\MSIF SET MSIF_DRIVE=X: SET MSIF_SCRIPTS=C:\MSIF SET MSIF_LOGIN=install SET MSIF_PASSWORD=install SET MSIF_FULLNAME=Sample Installation SET MSIF_ORGNAME=Microsoft Consulting Services SET PATH=%PATH%;C:\MSIF
2. Connect to MSIF Share
After the variables are set, MSIF connects to the MSIF share point. The error checking helps with troubleshooting slow connect times.
echo 2. Connecting to MSIF share point... :NETCONN NET USE %MSIF_DRIVE% %MSIF_SHARE% /USER:%MSIF_LOGIN% %MSIF_PASSWORD% IF ERRORLEVEL 1 Goto NetUseError Goto SkipNetUseError :NetUseError Echo Error connecting to image server! You may want to contact deployment support. Echo. Echo To retry connection, press ENTER. Echo To exit load, press CTRL+C. Pause GoTO NETCONN :SkipNetUseError
3. Set Windows NT Shell to Explorer
Next, POSTBOOT.CMD sets the Windows NT shell back to Windows NT Explorer to reduce the possibility of getting errors during application installation.
echo 4. Setting Windows NT shell to Explorer... rundll32 setupapi,InstallHinfSection DefaultInstall 128 -> %MSIF_SCRIPTS%\Explorer.INF
4. Package Installations & Configurations
This is where you add your own scripted application installations. Refer to the "POSTBOOT" section above for an example.
5. Prepare System for Final Reboot
This step applies POSTBOOT.INF changes, removes the network connection, and reboots the computer.
echo 5. Preparing system for Final Reboot... rundll32 setupapi,InstallHinfSection DefaultInstall 128 -> %MSIF_SCRIPTS%\PostBoot.INF C: NET USE %MSIF_DRIVE% /D C:\MSIF\SHUTDOWN.EXE /L /R /T:10 /Y POSTBOOT.INF removes the default logon password and disables the AutoAdminLogon flag. [AddReg] ; 1. Removes default AutoLogon on settings from WinLogon. HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","DefaultPassword",0,"" HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","AutoAdminLogon",,"0"
File Samples
Boot Disk/Hard Drive MSIF Files
CONFIG.SYS
FILES=30 DEVICE=A:\DOS\HIMEM.SYS /TESTMEM:OFF DEVICE=A:\DOS\EMM386.EXE NOEMS DOS=HIGH,UMB DEVICEHIGH=A:\NET\IFSHLP.SYS LASTDRIVE=Z
AUTOEXEC.BAT
Note: The code samples below are spaced for easier reading and lines are broken for layout only: entries should be on a single line.
@ECHO OFF REM ======================================================================== REM Author: Microsoft Consulting Services REM Date: May 1, 1998 REM Description: AUTOEXEC.BAT recreates disk partition, formats disk, loads network drivers, connects to image server, copies installation instructions to hard drive, and starts Windows NT installation. REM ======================================================================== REM ======================================================================== REM Determine Boot Status. REM REM This section is used to keep track of the progress of the REM installation for the purpose of forcing the system to reboot REM at desired intervals. It uses the STATUS environment REM variable to do this. REM REM The state of this variable is stored in A:\STATUS.BAT and REM will be one of three values: STEP1, STEP2 or BYPASS. If REM the boot disk becomes confused as to which step it is trying REM to execute, simply delete the STATUS.BAT file and the boot REM disk will begin at STEP1. REM REM ======================================================================== SET STATUS=STEP1 IF EXIST A:\STATUS.BAT CALL A:\STATUS.BAT CLS @ECHO. @ECHO Windows NT 4.0 Automated Installation Framework @ECHO Boot Disk - %STATUS%, Revision 4.0 @ECHO ------------------------------------------------------------------ @ECHO. IF %STATUS%==STEP2 GOTO STEP2 IF %STATUS%==BYPASS GOTO BYPASS GOTO STEP1 :STEP1 REM ======================================================================== REM REM Prompt for Information and Rebuild Disk Partition. REM REM 1. Prompt for Information. System uses a freeware utility called REM ENQUIRE.COM to prompt for input and set environment variables REM based on the input. For purposes of this boot disk the following REM environment variables are set: REM REM - TEMPLATE, used to load the correct MSIF template and MS-DOS REM network interface card. REM - COMPUTERNAME, this is used in SYSTEM.INI and UNATTEND.TXT REM REM After variant information has been collected, the boot disk saves REM the environment variables to a VARS.BAT file to be used during REM STEP2. REM REM 2. Rebuild Disk Partition. This section runs DEBUG.EXE to delete the REM pre-existing MS-DOS or non-DOS partitions and it creates a new REM small FAT16 MS-DOS partition using the undocumented REM FDISK 1 /PRI:500 command. The small partition size speeds up the REM initial formatting. Windows NT extends the partition size to its REM fullest potential during the load. REM REM - DEBUG.EXE, uses an MSDN documented input text file to REM "wipe" the disk REM - FDISK.EXE, creates new primary MS-DOS partition (500 MB). REM REM ======================================================================== REM 1. Prompt for Information. ECHO. ECHO MSIF Configuration Template Menu: ECHO. ECHO 1) Compaq LTE 5200 (CPQ5200A) ECHO 2) Dell OptiPlex GXa (DELLA) ECHO 3) Boot to DOS ECHO. ENQUIRE "Enter choice (1, 2, or 3) = ", OPTION if "%OPTION%" == "1" SET TEMPLATE=CPQ5200A if "%OPTION%" == "2" SET TEMPLATE=DELLA if "%OPTION%" == "3" GOTO END ECHO. ENQUIRE "Enter name of computer = ", COMPUTERNAME ECHO. ECHO SET TEMPLATE=%TEMPLATE%> A:\VARS.BAT ECHO SET COMPUTERNAME=%COMPUTERNAME%>> A:\VARS.BAT ECHO SET LOGIN=install>> A:\VARS.BAT ECHO SET PASSWORD=install>> A:\VARS.BAT ECHO SET WORKGROUP=usa-detroit>> A:\VARS.BAT ECHO SET DOMAIN=loadsite>> A:\VARS.BAT ECHO SET NETDRIVE=x:>> A:\VARS.BAT ECHO SET NETSERVER=[SERVER_NAME]>> A:\VARS.BAT ECHO SET NETSHARE=MSIF>> A:\VARS.BAT REM 2. Rebuild Disk Partition. ECHO SET STATUS=STEP2 > A:\STATUS.BAT a:\debug.exe < a:\delpart.txt a:\fdisk.exe 1 /PRI:500 /Q a:\reboot.com :STEP2 REM ======================================================================== REM REM Format Disk, Load Network, and Run Operating System Installation REM REM 1. Formats disk using the standard command-line switches available REM and an input text file that simply contains the character "y". REM This is used to respond to the question, "Do you want to REM continue?" REM REM 2. BYPASS: can be used to "bypass" disk partitioning and formatting REM during testing and troubleshooting. REM REM 3. SmartDrive is loaded to optimize the memory allocation. REM REM 4. Set environment variables stored in VARS.BAT. REM REM 5. Loads the network adapter associated with the selected MSIF REM template, then updates the "clean" version of the network- REM adapter-specific SYSTEM.INI file with the environment variables. REM REM 6. Starts the network by logging on and then connecting to the MSIF REM network share. REM REM 7. Copies down MSIF template files to C:\MSIF and edits the "clean" REM copy of the UNATTEND.TXT with new computername. REM REM 8. Resets the MSIF boot disk by setting the STATUS flag file equal REM to STEP1. REM REM 9. Start Windows NT load. REM REM ======================================================================== ECHO Preparing Computer's Hard Drive and Network... ECHO 1. Formating Hard Drive... a:\format C: /U /V:CORP < a:\format.txt ECHO 2. Setting BYPASS Flag... ECHO SET STATUS=BYPASS > A:\STATUS.BAT :BYPASS ECHO 3. Loading SmartDrive... a:\net\smartdrv.exe /x 2048 > nul ECHO 4. Setting Environment Variables Stored in VARS.BAT... CALL A:\VARS.BAT ECHO 5. Loading %TEMPLATE%... copy a:\net\%TEMPLATE%\*.* a:\net change a:\net\system.ini computername= computername=%COMPUTERNAME% > nul change a:\net\system.ini logondomain= logondomain=%DOMAIN% > nul change a:\net\system.ini username= username=%LOGIN% > nul change a:\net\system.ini workgroup= workgroup=%workgroup% > nul path=a:\;a:\net CLS ECHO ------------------------------------------------------------------- ECHO. ECHO WARNING! ECHO. ECHO Please remove diskette from the A: drive once the NT installation starts. ECHO. ECHO ------------------------------------------------------------------- ECHO. ECHO 6. Starting Network... a:\net\net logon %LOGIN% %PASSWORD% /YES /SAVEPW:NO a:\net\net use %NETDRIVE% \\%NETSERVER%\%NETSHARE% ECHO 7. Downloading MSIF Template Files... C: cd \ md msif copy %NETDRIVE%\TEMPLATE\%TEMPLATE%\*.* c:\msif change c:\msif\unattend.txt ComputerName= ComputerName=%COMPUTERNAME% > nul ECHO 8. Resetting MSIF Boot Disk...... ECHO SET STATUS=STEP1 > A:\STATUS.BAT ECHO 9. Starting Operating System Installation... c:\msif\install :END
STATUS.BAT
Default setting on initial boot:
SET STATUS=STEP1
DELPART.TXT
a 100 int 13 rax 0301 rbx 0200 f 200 l 200 0 rcx 0001 rdx 0080 p q
Windows NT Operating System Installation
INSTALL.BAT
X:\Nt4Wks\i386\WinNT /u:C:\MSIF\Unattend.txt /s:X:\Nt4Wks\i386
UNATTEND.TXT
[Unattended] OemPreinstall = yes NoWaitAfterTextMode = 1 NoWaitAfterGUIMode = 1 OEMSkipEula = yes FileSystem = ConvertNTFS ExtendOEMPartition = 0 ConfirmHardware = no NtUpgrade = no Win31Upgrade = no TargetPath = WINNT OverwriteOemFilesOnUpgrade = no [OEM_Ads] Banner = "Windows NT 4.0 *Automated Installation Framework" [UserData] FullName = "Build 1.0, rev 1" OrgName = "Microsoft Corporation" ComputerName = MCSTEST ProductId = "222-222222" [GuiUnattended] OemSkipWelcome = 1 OEMBlankAdminPassword = 1 TimeZone = "(GMT-05:00) Eastern Time (US & Canada)" [Display] ConfigureAtLogon = 0 BitsPerPel = 10 XResolution = 800 YResolution = 600 VRefresh = 60 AutoConfirm = 1 [Network] DetectAdapters = "" InstallProtocols = ProtocolsSection InstallServices = ServicesSection JoinWorkgroup = "USA-DETROIT" [ProtocolsSection] NBF = NBFParamSection [NBFParamSection] [ServicesSection]
CMDLINES.TXT
[Commands]
"rundll32 setupapi,InstallHinfSection DefaultInstall 128 C:\MSIF\RunOnce.inf" "C:\WINNT\NT4SP3\Update.exe -u -n -z"
RUNONCE.INF
; Windows NT 4.0 Automated Installation Framework ; RunOnce ; ; 1. Forces Windows NT shell from Explorer to be PREBOOT.CMD ; 2. Forces default user / password and enables autologon ; - Sets Default User to Administrator ; - Sets Default Password to blank ; - Enables AutoLogon ; 3. Disables default Windows NT Tips ; ---------------------------------------------------------- [Version] Signature = "$Windows NT$" [DefaultInstall] AddReg = AddReg DelReg = DelReg UpdateInis = UpdateInis [AddReg] ; 1. Forces Windows NT shell from Explorer to be PREBOOT.CMD HKLM, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "Shell", 0, "Explorer.exe C:\MSIF\PreBoot.cmd" ; 2. Forces default user / password and enables autologon HKLM, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultUserName", 0, "Administrator" HKLM, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultPassword", 0, "" HKLM, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "AutoAdminLogon", , "1" ; 3. Disables default Windows NT Tips HKCU, "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Tips", "DisplayInitialTipWindows", 65537, 0 HKCU, "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Tips", "Show", 1, 0, 0, 0, 0 HKCU, "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Tips", "Next", 1, 3, 0 [DelReg] [UpdateInis]
PREBOOT.CMD
@echo OFF REM ============================================================ REM REM File: PREBOOT.CMD REM Date: May 1, 1998 REM Author: Microsoft Consulting Services REM REM Desc: This file begins Pre-Reboot phase of the unattended load REM of applications and system configuration. It is the REM first of two Windows NT shells. RunOnce.Inf executed at REM the end of the standard Windows NT load (executed via REM cmdlines.txt) sets PREBOOT.CMD as the new REM Windows NT shell. REM REM PreReboot (PREBOOT.CMD) performs the following steps: REM REM 1. Sets standard MSIF environment variables. REM 2. Connects to MSIF share point. This share has the REM operating system, applications, and any REM specific system configuration information. REM 3. All standard utility files such as SHUTDOWN and REM DELTREE are copied down from \UTILITIES to C:\MSIF. REM 4. Resets Windows NT shell back to Explorer while REM executing PREBOOT.CMD. This eliminates the possibility REM of applications being installed "restarting" the REM Windows NT shell during their installation process. REM 5. Installs all of the Pre-Reboot packages destined to REM run before reboot. REM 6. Sets Windows NT shell to POSTBOOT.CMD for Post-Reboot REM and restarts the computer. REM REM =================================================================== cls echo. echo Windows NT 4.0 Automated Installation Framework echo PreBoot Phase echo ------------------------------------------------------------------- echo 1. Setting environment variables... SET MSIF_SHARE=\\[SERVER_NAME]\MSIF SET MSIF_DRIVE=X: SET MSIF_SCRIPTS=C:\MSIF SET MSIF_LOGIN=install SET MSIF_PASSWORD=install SET MSIF_FULLNAME=Sample Installation SET MSIF_ORGNAME=Microsoft Consulting Services SET PATH=%PATH%;C:\MSIF echo 2. Connecting to MSIF share point... :NETCONN NET USE %MSIF_DRIVE% %MSIF_SHARE% /USER:%MSIF_LOGIN% %MSIF_PASSWORD% IF ERRORLEVEL 1 Goto NetUseError Goto SkipNetUseError :NetUseError Echo Error connecting to image server! You may want to contact deployment support. Echo. Echo To retry connection, press ENTER. Echo To exit load, press CTRL+C. Pause GoTO NETCONN :SkipNetUseError echo 3. Copying MSIF and other handy utilities to C:\MSIF... %MSIF_DRIVE% COPY \UTILITIES\*.* C:\MSIF echo 4. Setting Windows NT shell to Explorer... rundll32 setupapi,InstallHinfSection DefaultInstall 128 %MSIF_SCRIPTS%\Explorer.INF echo 5. Running Pre-Reboot package installations and configurations... echo Office 97 Professional Edition %MSIF_DRIVE% CD \OFF97ADM CALL OFF97ADM.BAT SLEEP 5 echo 6. Preparing system for Post-Reboot phase... rundll32 setupapi,InstallHinfSection DefaultInstall 128 %MSIF_SCRIPTS%\PreBoot.INF C: NET USE %MSIF_DRIVE% /D
PREBOOT.INF
; Windows NT 4.0 Automated Installation Framework. ; Pre-Reboot Phase. ; ; 1. Forces Windows NT shell to be POSTBOOT.CMD. ; 2. Forces default user/password and enables autologon. ; - Sets Default User to Administrator ; - Sets Default Password to blank ; - Enables AutoLogon ; --------------------------------------------------------------------- [Version] Signature = "$Windows NT$" [DefaultInstall] AddReg = AddReg DelReg = DelReg UpdateInis = UpdateInis [AddReg] ; 1. Change Windows NT shell from PREBOOT.CMD to POSTBOOT.CMD HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "Shell",0,"Explorer.exe C:\MSIF\PostBoot.cmd" ; 2. Forces default user / password and enables autologon HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultUserName",0,"Administrator" HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultPassword",0,"" HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "AutoAdminLogon", ,"1" [DelReg] [UpdateInis]
POSTBOOT.CMD
@echo OFF REM ======================================================================== REM File: POSTBOOT.CMD REM Date: May 1, 1998 REM Author: Microsoft Consulting Services REM REM Desc: This file begins the Post-Reboot phase of the unattended REM load of applications and system configuration. POSTBOOT is the REM second of 2 Windows NT shells run. REM REM Post-Reboot (POSTBOOT.CMD) performs the following steps: REM REM 1. Sets standard MSIF environment variables. REM 2. Resets Windows NT shell back to Explorer while executing REM POSTBOOT.CMD. This eliminates the possibility of REM applications being installed "restarting" the Windows NT REM shell during their installation process. REM 3. Connects to MSIF share point. This share has the REM operating system, applications, and any REM specific system configuration information. REM 4. Installs all of the Post-Reboot packages destined for REM after reboot. REM 5. Disables auto-logon, disconnects MSIF network REM drive and restarts the computer. REM REM ======================================================================== cls echo. echo Windows NT 4.0 Automated Installation Framework echo Post-Reboot echo ------------------------------------------------------------------- echo 1. Setting environment variables... SET MSIF_SHARE=\\[SERVER_NAME]\MSIF SET MSIF_DRIVE=X: SET MSIF_SCRIPTS=C:\MSIF SET MSIF_LOGIN=install SET MSIF_PASSWORD=install SET MSIF_FULLNAME=Sample Installation SET MSIF_ORGNAME=Microsoft Consulting Services SET PATH=%PATH%;C:\MSIF echo 2. Connecting to MSIF share point... :NETCONN NET USE %MSIF_DRIVE% %MSIF_SHARE% /USER:%MSIF_LOGIN% %MSIF_PASSWORD% IF ERRORLEVEL 1 Goto NetUseError Goto SkipNetUseError :NetUseError Echo Error connecting to image server! You may want to contact deployment support. Echo. Echo To retry connection, press ENTER. Echo To exit load, press CTRL+C. Pause GOTO NETCONN :SkipNetUseError echo 3. Setting Windows NT shell to Explorer... rundll32 setupapi,InstallHinfSection DefaultInstall 128 %MSIF_SCRIPTS%\Explorer.INF echo 4. Running Post-Reboot package installations and configurations... REM echo IntelliMouse Driver REM %MSIF_DRIVE% REM CD \IMOUSE21 REM CALL IMouse21.BAT REM SLEEP 5 echo 5. Preparing system for Final Reboot... rundll32 setupapi,InstallHinfSection DefaultInstall 128 %MSIF_SCRIPTS%\PostBoot.INF C: NET USE %MSIF_DRIVE% /D C:\MSIF\SHUTDOWN.EXE /L /R /T:10 /Y
POSTBOOT.INF
; Windows NT 4.0 Automated Installation Framework ; Post-Reboot Phase ; ; 1. Removes default AutoLogon on settings from WinLogon ; - Removes Default Password ; - Disables AutoLogon ; -------------------------------------------------------------------- [Version] Signature = "$Windows NT$" [DefaultInstall] AddReg = AddReg DelReg = DelReg [AddReg] ; 1. Removes default AutoLogon on settings from WinLogon HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultPassword",0, "" HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "AutoAdminLogon",, "0" [DelReg]
EXPLORER.INF
; Microsoft Windows NT Installation Framework ; Microsoft Consulting Services ; Revision 4.0 ; Explorer.Inf - Configure Windows NT Shell to Explorer ; ; 1. Sets Windows NT shell to Explorer while load is in operation ; -------------------------------------------------------------------- [Version] Signature = "$Window NT$" [DefaultInstall] AddReg = AddReg DelReg = DelReg [AddReg] ; 1. Sets Windows NT shell to Explorer while load is in operation HKLM, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "Shell",0, "Explorer.exe" [DelReg]
UNATTEND.TXT Parameters (TechNet)
Windows NT Command Line
Windows NT 4.0 uses an unattended method of setup with the /U switch. The syntax is:
winnt /u:<answer file> /s:<location of source files>
-or-
Winnt32 /u:<answer file> /s:<location of source files>
The <answer file> is a text file that contains all the answers a user normally would be required to enter during Windows NT setup. You can create this file with a text editor or with Setup manager (SETUPMGR.EXE, in the resource kit). Listed below are all valid answer file parameters along with their possible values. For a further explanation of these values, go to https://www.microsoft.com and download the self-extracting file DEPLOY.EXE.
Sample UNATTEND.TXT File
;[Unattended] ;Method = Express|Custom ;NtUpgrade = Yes|No ;Win31Upgade = Yes|No ;TargetPath = *|<Path Name>|Manual ;OverwriteOemFilesOnUpgrade = Yes|No ;ConfirmHardware = Yes|No ;OEMPreinstall = Yes|No ;NoWaitAfterTextMode = (0 = stop, 1 = Reboot) ;NoWaitAfterGuiMode = (0 = stop, 1 = Reboot) ;FileSystem = ConvertNTFS|LeaveAlone ;ExtendOemPartition = (0 = no, 1 = Yes) ; *\PARTNER *\; *\; OemSkipEula is undocumented at this time and is *\; supported only for Premier accounts. *\; *\;OemSkipEula = Yes|No *\ ; ; Descriptions are from the COMPUTER Section of TXTSETUP.SIF ; ====================================================== ; ComputerType = "AST Manhattan SMP","RETAIL" ; ComputerType = "Compaq SystemPro Multiprocessor or 100% Compatible","RETAIL" ; ComputerType = "Corollary C-bus Architecture","RETAIL" ; ComputerType = "Corollary C-bus Micro Channel Architecture","RETAIL" ; ComputerType = "IBM PS/2 or other Micro Channel-based PC","RETAIL" ; ComputerType = "MPS Uniprocessor PC","RETAIL" ; ComputerType = "MPS Multiprocessor PC","RETAIL" ; ComputerType = "MPS Multiprocessor Micro Channel PC","RETAIL" ; ComputerType = "NCR System 3000 Model 3360/3450/3550","RETAIL" ; ComputerType = "Olivetti LSX5030/40","RETAIL" ; ComputerType = "Standard PC","RETAIL" ; ComputerType = "Standard PC with C-Step i486","RETAIL" ; ComputerType = "Wyse Series 7000i Model 740MP/760MP","RETAIL" ;KeyBoardLayout = <Layout description> ; Example; ; KeyBoardLayout = "US-International" ;[GuiUnattended]======================================== ;[GuiUnattended] ;OemSkipWelcome = (0 = no, 1 = Yes) ;OemBlankadminPassword = (0 = no, 1 = Yes) ;TimeZone = <Time Zone> ; The following are strings for AdvServerType ; AdvServerType = LANMANNT ; AdvServerType = LANSECNT ; AdvServerType = SERVERNT ; Definition of Server Type ; LANMANNT=PDC ; LANSECNT=BDC ; SERVERNT=Standalone ;[UserData]============================================ ;[UserData] ;FullName = <user name> ;OrgName = <company name> ;ComputerName = <computer name> ;ProductID = <product ID> (CD-key) ; ; Note if PID is for an OEM version of WINDOWS NT the algorithm ; for the PID is: xxxyy-OEM-0000016-zzzzz ; ; x = Julian calendar date for the day ; y = The current year (last two digits) ; z = Any numeric combination you want ; ; ;[LicenseFilePrintData]================================= ;[LicenseFilePrintData] ; AutoMode = PerServer or PerSeat ; AutoUser = xxxx or PerServer ;[NetWork]============================================== ;[NetWork] ;Attend = Yes|No ; This value should not be specified for a complete unattended install. ; ;JoinWorkGroup = <workgroup name> ;JoinDomain = <Domain name> ;CreateComputerAccount = <user_name, password> ;InstallDC = <domain name> ;InstallAdapters = <Install adapters section> ; ; If not AUTODETECTED do not use ; this option ; ;DetectAdapters = <detect adapters section>|"" ; ;InstallProtocols = <Protocol(s) list section> ;InstallServices = <Sevices list section> ;InstallInternetServer <internet information server parameters> ;DoNotInstallInternetServer = Yes|No ;[detect adapters section] ; ; Used only if the adapter AUTODETECTED by setup. ; ;DetectCount = <Number of detection attempts> ;LimitTo = <netcard inf option> ;Example; ; LimitTo = DECETHERWORKSTURBO ;[Install adapters section] ; Examples; ; DECETHERWORKSTURBO = DECETHERWORKSTURBOParams ; EE16 = EE16Params ;[DECETHERWORKSTURBOParams] ;InterruptNumber = 5 ;IOBaseAddress = 768 ;Note!! all numbers in these sections ;MemoryMappedBaseAddress = 851968 ;are converted from hex to decimal ;!AutoNetInterfaceType = 1 ;(768 = 300h). You can get these ;!AutoNetBusNumber = 0 ;values from the registry of a ; ;computer with the adapter installed. ;[EE16Params] ;!AutoNetInterfaceType = 1 ;Transceiver = 3 ;!AutoNetBusNumber = 0 ;IoChannelReady = 2 ;IoBaseAddress = 784 ;InterruptNumber = 10 ;[Protocol(s) list section] ; OEM File listing for protocols ; ; TCPIP - OEMNXPTC.INF ; NETBEUI - OEMNXPNB.INF ; IPX - OEMNSVNW.INF ; DLC - OEMNXPDL.INF ; Point to Point Protocol - OEMNXPPP.INF ; STREAMS - OEMNXPST.INF ; Apple Talk - OEMNXPSM.INF ; ; TC = TCPIPParams ; NBF = NetBeuiParams ; NWLNKIPX = NWLINKIPXParams ; DLC = DLCParams ; RASPPTP = RASPPTPParams ; STREAMS = STREAMSParams ; ATALK = ATALKParams ;[TCPIPParams] ; DHCP = yes|no ; IPAddress = www.xxx.yyy.zzz ; Subnet = www.xxx.yyy.zzz ; Gateway = www.xxx.yyy.zzz ; DNSServer = www.xxx.yyy.zzz www.xxx.yyy.zzz www.xxx.yyy.zzz ; WINSPrimary = www.xxx.yyy.zzz ; WINSSecondary = www.xxx.yyy.zzz ; DNSName = <DNS name server> ; ScopeID = This_is_the_scope_id ;[NetBeuiParams] ; No parameters needed ;[NWLINKIPXParams] ; No parameters needed ;[DLCParams] ; No parameters needed ;[RASPPTPParams] ; No parameters needed ;[STREAMSParams] ; No parameters needed ;[ATALKParams] ; You need to figure out how to set the default zone and adapter. This ; is needed for printing. Many high-end publishing companies use Apple ; printers on their networks and need this protocol to print. See the ; Windows NT Setup Guide for details on settings such as these. ;[Sevices list section] ; NWWKSTA = InstallCSNW ; SNMP = InstallSNMP ; RAS = InstallRemoteAccess ; NETMON = InstallNetMon ; STCPIP = InstallSimpleTCP ; TCPPRINT = InstallTCPPrint ; INETSTP = InstallInternetServer ; SAP = InstallSAP ;[InstallCSNW] ; DefaultLocation = <server location (usually preferred server)> ; DefaultScriptOption = 0|1|3 ; 0 = No scripts will be run ; 1 = Netware 3.X level scripts ; 3 = Either Netware 3.X or 4.X level scripts can be run ;[InstallSNMP] ; Accept_CommunityName = Name1, Name2, Name3 (Max is 3) ; Send_Authentication = yes | no ; AnyHost = yes | no ; Limit_Host = host1, host2, host3 (Max is 3) ; Community_name = <Community name> ; Traps = IPaddress | IPXaddress (max of 3 IP or IPX addresses) ; Contact_Name = <user name> ; Location = <computer location> ; Service = Physical, Applications, Datalink, Internet, EndToEnd ;[Modem]================================================ ;[Modem] ;InstallModem = <Modem parameter section> ; Example; ; InstallModem = MyModem ; ;[ModemParameterSection] ;<Com Port Number> = <Modem description> ; Example; ; Com2 = "Hayes V-Series Ultra Smartmodem 9600" ; ; ;[InstallRemoteAccess] ; ; PortSections = <port section name> ; DialoutProtocols = TCPIP|IPX|NetBEUI|All ; DialInProtocols = TCPIP|IPX|NetBEUI|All ; NetBEUIClientAccess = Network|ThisComputer ; TCPIPClientAccess = Network|ThisComputer ; IPXClientAccess = Network|ThisComputer ; UseDHCP = Yes|No ; StaticAddressBegin = <IP address> (used only if UseDHCP = No) ; StaticAddressEnd = <IP address> (used only if UseDHCP = No) ; ExcludeAddress = <IP address1 - IP address2> ; The above is used to exclude a range of addresses when a range ; has been assigned manually. Requires that StaticAddressBegin and ; StaticAddressEnd are specified already. ; ; ClientCanRequestIPAddress = Yes|No ; AutomaticNetworkNumbers = Yes|No ; NetworkNumberFrom <IPX Net Number> ; AssignSameNetworkNumber = Yes|No ; ClientsCanRequestIpxNodeNumber = Yes|No ; [port section name] ; PortName = COM1|COM2|COM3-COM25 ; DeviceType = modem (presently only value available) ; DeviceName = "Hayes V-Series Ultra Smartmodem 9600" ; PortUsage = DialOut|DialIn|DialInOut ;[InstallNetMon] ;[InstallSimpleTCP] ;[InstallTCPPrint] ;[<internet information server parameters>] ; ; (0 = do not install, 1 = install) ; InstallINETSTP = 0|1 ; InstallFTP = 0|1 ; InstallWWW = 0|1 ; InstallGopher = 0|1 ; InstallADMIN = 0|1 ; InstallMosaic = 0|1 ; InstallGateway = 0|1 ; InstallDNS = 0|1 ; InstallHELP = 0|1 ; InstallSMALLPROX = 0|1 ; InstallCLIENTADMIN = 0|1 ; WWWRoot = <www root directory i.e. C:\INETSRV\WWW> ; FTPRoot = <FTP root directory i.e. C:\ftp> ; GopherRoot = <gopher root directory i.e C:\INETSRV\GOPHER> ; InstallDir = <Internet services install directory> ; EmailName = <E-mail Name i.e. john@org.com> ; UseGateway = 1 ; GatewayList = \\gateway1 \\gateway2 \\gateway3 ; DisableSvcLoc = 1 ; GuestAccountName <name> ; GuestAccountPassword <password string> ; ;[InstallSAP] ;[DisplayDrivers]======================================= ; [DisplayDrivers] ; <Display driver description> = Retail|Oem ;[Display]============================================== ;[Display] ; ; For this to fully automate, the ConfigureAtLogon cannot be used. ; ; ConfigureAtLogon = (0 = during setup, 1 = at first logon) ; ;BitsPerPel = <Valid bits per pixel> ;XResolution = <Valid X resolution> ;YResolution = <Valid Y resolution> ;VRefresh = <Valid refresh rate> ;Flags = <Valid flags> ;AutoConfirm = (0 = do not use specified settings, ; 1 = use pre-defined settings) ;InstallDriver (0 = No, 1 = Yes) ;InfFile = <inf file name 1>,<inf file name 2>,....... ;InfOption = <inf option 1>,<inf option 2>,......... ; Example: ; InstallDriver = 1 ; InfFile = S3.inf, Matrox.inf ; InfOption = s3 765, Millenium 3D ;[KeyBoardDrivers]====================================== ;[KeyBoardDrivers] ;"XT, AT, or Enhanced Keyboard (83-104 keys)" = "RETAIL" ; Descriptions are from the KEYBOARD Section of TXTSETUP.SIF ; ====================================================== ; "XT, AT, or Enhanced Keyboard (83-104 keys)" = "RETAIL" ;[PointingDeviceDrivers]================================ ;[PointingDeviceDrivers] ; Descriptions are from the MOUSE Section of TXTSETUP.SIF ; ====================================================== ; "Microsoft Mouse Port Mouse (includes BallPoint)" = "RETAIL" ; "Logitech Mouse Port Mouse" = "RETAIL" ; "Microsoft InPort Bus Mouse" = "RETAIL" ; "Microsoft Serial Mouse" = "RETAIL" ; "Microsoft BallPoint Serial Mouse" = "RETAIL" ; "Logitech Serial Mouse" = "RETAIL" ; "Microsoft (Green Buttons) or Logitech Bus Mouse" = "RETAIL" ; "No Mouse or Other Pointing Device" = "RETAIL" ; "Microsoft Mouse Port Mouse (includes BallPoint)" = "RETAIL" ;[MassStorageDrivers]=================================== ;[MassStorageDrivers] ; Descriptions are from the SCSI Section of TXTSETUP.SIF ; ====================================================== ; "Adaptec AHA-151X/AHA-152X or AIC-6260/AIC-6360 SCSI Host ; Adapter" = "RETAIL" ; "Adaptec AHA-154X/AHA-164X SCSI Host Adapter" = "RETAIL" ; "Adaptec AHA-174X EISA SCSI Host Adapter" = "RETAIL" ; "Adaptec AHA-274X/AHA-284X/AIC-777X SCSI Host Adapter" = "RETAIL" ; "Adaptec AHA-294X/AHA-394X or AIC-78XX PCI SCSI Controller" = "RETAIL" ; "Adaptec AHA-2920 or Future Domain 16XX/PCI/SCSI2Go SCSI Host ; Adapter" = "RETAIL" ; "AMD PCI SCSI Controller/Ethernet Adapter" = "RETAIL" ; "AMIscsi SCSI Host Adapter" = "RETAIL" ; "BusLogic SCSI Host Adapter" = "RETAIL" ; "BusLogic FlashPoint" = "RETAIL" ; "Compaq 32-Bit Fast-Wide SCSI-2/E" = "RETAIL" ; "Compaq Drive Array" = "RETAIL" ; "Dell Drive Array" = "RETAIL" ; "DPT SCSI Host Adapter" = "RETAIL" ; "Future Domain TMC-7000EX EISA SCSI Host Adapter" = "RETAIL" ; "Future Domain 8XX SCSI Host Adapter" = "RETAIL" ; "IBM MCA SCSI Host Adapter" = "RETAIL" ; "IDE CD-ROM (ATAPI 1.2)/Dual-channel PCI IDE Controller" = "RETAIL" ; "Mitsumi CD-ROM Controller" = "RETAIL" ; "Mylex DAC960/Digital SWXCR-Ex Raid Controller" = "RETAIL" ; "NCR 53C9X SCSI Host Adapter" = "RETAIL" ; "NCR C700 SCSI Host Adapter" = "RETAIL" ; "NCR 53C710 SCSI Host Adapter" = "RETAIL" ; "Symbios Logic C810 PCI SCSI Host Adapter" = "RETAIL" ; "Olivetti ESC-1/ESC-2 SCSI Host Adapter" = "RETAIL" ; "QLogic PCI SCSI Host Adapter" = "RETAIL" ; "MKEPanasonic CD-ROM Controller" = "RETAIL" ; "Sony Proprietary CD-ROM Controller" = "RETAIL" ; "UltraStor 14F/14FB/34F/34FA/34FB SCSI Host Adapter" = "RETAIL" ; "UltraStor 24F/24FA SCSI Host Adapter" = "RETAIL" ;[DetectedMassStorage]================================== ;[DetectedMassStorage] ;[OEMAds]=============================================== ;[OEMAds] ;Banner = <text string> (must be enclosed in quotes and have ; the string 'Windows NT') ; Example; ; Banner = "My own Windows NT setup" ;Logo = <file name> ;Background = <file name>
Handy Miscellaneous Registry Settings
Controlling Which Accessories are Installed
For your reference, here is Knowledge Base article 156813.
Title: Controlling which Accessories are Installed During Setup
The information in this article applies to:
Microsoft Windows NT Workstation versions 4.0
Microsoft Windows NT Server versions 4.0
Summary
By default unattended setup does not provide a way to control what accessory applications are installed on the Start Menu\Programs\Accessories menu.
More Information
Warning: Modifying .INF files incorrectly can cause serious, system-wide problems that may require you to reinstall Windows NT to correct them. Microsoft cannot guarantee that any problems resulting from .INF file modifications can be solved. Use this method at your own risk.
Each application or group of applications on the Accessories menu has an associated Information File (.INF). Each .INF uses the variable InstallType to determine if the application is to be installed.
There are three values that InstallType can equal:
0 = Manual only
10 = Typical or Custom
14 = Typical, Custom, or Portable
The following INF files use the InstallType variable. The list of INF files can be found under the [BaseWinOptionsInfs]in the SYSSETUP.INF.
accessor.inf
communic.inf
games.inf
imagevue.inf
mmopt.inf
multimed.inf
optional.inf
pinball.inf
wordpad.inf
The following example is the section for Free Cell from the GAMES.INF for Windows NT 4.0 Server. By default games are not installed on server. Since Unattended Setup uses Typical for installation purposes a value of 10 can be used for InstallType. By default InstallType for Free Cell is 0.
[Freecell] OptionDesc = %Freecell_DESC% Tip = %Freecell_TIP% IconIndex = 62 ;Windows mini-icon for dialogs Parent = Games ; ; This is the value that is changed. ; To install Free Cell change InstallType from 0 to 10 ; InstallType = 0 ;Manual only CopyFiles = FreecellCopyFilesSys, FreecellCopyFilesHelp AddReg = FreecellAddReg UpdateInis = FreecellInis Uninstall = FreecellUninstall Upgrade = FreecellUpgrade Detect = %11%\freecell.exe
Additional Information
To take advantage of the InstallType variable for manual or unattended installations of Windows NT a certain amount of preparation is needed.
The contents of the i386 directory from the Windows NT 4.0 CD needs to be copied to a distribution share.
For each .INF file that needs to be modified the file first needs to be expanded and the original file renamed.
EXPAND GAMES.IN_ GAMES.INF RENAME GAMES.IN_ GAMES.SAV
**Note:** The Windows NT version of EXPAND.EXE needs to be used.
Edit the INF file and change the InstallType value.
0 = Manual only 10 = Typical or Custom 14 = Typical, Custom, or Portable
KBCategory: **kbsetup**
KBSubcategory: **ntsetup ntdriver ntreskit**
Additional reference words: **prodnt 4.00**
Registry Punch—Windows NT Source Path
; Windows NT 4.0 Automated Installation Framework ; File Format: INF ; ; 1. Forces Windows NT source path to \\[SERVER_NAME]\MSIF\NT4Wks\i386 ; ---------------------------------------------------------------------- [Version] Signature = "$Windows NT$" [DefaultInstall] AddReg = AddReg DelReg = DelReg UpdateInis = UpdateInis [AddReg] ; 1. Forces Windows NT source path to be S:\NT4Wks\i386 HKLM,"Software\Microsoft\Windows\CurrentVersion\Setup","SourcePath",0, "\\[SERVER_NAME]\MSIF\NT4Wks\i386" HKLM,"Software\Microsoft\Windows NT\CurrentVersion","SourcePath",0, "\\[SERVER_NAME]\MSIF\NT4Wks\i386" [DelReg] [UpdateInis]
Registry Punch—Default Screen Saver
REGEDIT4
; Windows NT 4.0 Automated Installation Framework ; File Format: REG ; ; 1. Sets the default Screen Saver information to be copied to each ; user account when logging in for the first time at a machine. ; 2. Sets the default Screen Saver information for the Local ; Administrator account by saving settings to current user when ; logged on as Administrator during initial installation. ; ------------------------------------------------------------------ ; 1. Sets the default Screen Saver information to be copied to each ; user account when logging in for the first time at a machine. [HKEY_USERS\Default User\Control Panel\Desktop] "ScreenSaveTimeOut"="300" "ScreenSaveActive"="1" "ScreenSaverIsSecure"="1" "SCRNSAVE.EXE"="C:\\WINNT\\System32\\logon.scr" ; 2. Sets the default Screen Saver information for the Local ; Administrator account by saving settings to current user when ; logged on as Administrator during initial installation. [HKEY_CURRENT_USER\Control Panel\Desktop] "ScreenSaveTimeOut"="600" "ScreenSaveActive"="1" "ScreenSaverIsSecure"="1" "SCRNSAVE.EXE"="C:\\WINNT\\System32\\logon.scr"
Registry Punch—Disable Browse Master/LMAnnouce
REGEDIT4
; Windows NT 4.0 Automated Installation Framework ; File Format: REG ; ; 1. Disables MaintainServerList and IsDomainMaster ; 2. Disables LMAnnounce ; ------------------------------------------------------------------ ; 1. Disables MaintainServerList and IsDomainMaster [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Browser\ Parameters] "MaintainServerList"="OFF" "IsDomainMaster"="FALSE" ; 2. Disables LMAnnounce [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\ Parameters] "Lmannounce"=dword:00000000
Registry Punch—Disable Pop-Up Print Notification
REGEDIT4
; Windows NT 4.0 Automated Installation Framework ; File Format: REG ; ; 1. Sets Pop-Up Print Notification off. ; --------------------------------------------------------------- [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Providers]
Quick Reference for Unattended Installation
Here is a summary of tools and methods created by MCS. It is not comprehensive, but it lists some things you can use to get started.
Steps |
Method |
Notes |
---|---|---|
Basic installation |
WINNT /U:UNATTENDED.TXT |
Allows unattended installation of basic environment (in other words, SCSI, keyboard, display drivers; creation or joining domains or standalone; installation of services such as, DHCP, WINS, SNMP, DNS) All unattended Windows NT installation starts from here. See MS Windows NT Workstation Deployment Guide - Automating Windows NT Setup and the Automating Windows NT Setup Deployment Guide Supplement. |
Personalizing after basic installation |
Use \I386\$OEM$\CMDLINES.TXT to set RunOnce registry key to run a personalized batch file, For example: RUNONCE.CMD |
Create a batch file called whatever you want (for example, RUNONCE.CMD) having the calls to utility and commands you need to personalize your setup (for example, DHCP configuration of range and scope, adding users, creating shares and printers, and so on). |
Personalizing after basic installation (continued) |
|
The key in registry is: HKEY_LOCAL_MACHINE\Software\Microsoft\CurrentVersion\Windows\RunOnce. To allow the batch to run, you also need to set: HKEY_LOCAL_MACHINE\Software\Microsoft\CurrentVersion\Winlogon\AutoAdminLogon=1 and to set a valid DefaultUsername, DefaultPassword and DefaultDomain. Keep in mind that for this to work correctly work you must have DontDisplayLastUsername=0. Without it you'll get a "wrong password" message. |
Personalizing: disk label |
Command LABEL in batch file |
For example: LABEL E: USER |
Personalizing: BOOT.INI timeout |
Use Rundll32 Setupapi |
The second way to apply it is in CMDLINES.TXT when you do an OEM preinstall. You could use the same .INF file, but you would have to copy ATTRIB.EXE to the $OEM$ directory, and put the following in CMDLINES.TXT: .\attrib.exe c:\boot.ini -s -h –r rundll32 setupapi,InstallHinfSection DefaultInstall 128 .\bootini.inf .\attrib.exe c:\boot.ini +s +h +r You could also execute the attrib and rundll32 commands in a batch file done with a runonce after setup, or via an SMS job. |
Personalizing: Renaming accounts or changing password |
Use CUSRMGR.EXE by G. Zanzen |
For example: CUSRMGR -u Administrator -r BNAdmin CUSRMGR -u BNAdmin -P BNAdmin |
Personalizing: Managing users and groups |
ADDUSERS (NTRK) USRTOGRP (NTRK) NET USER NET GROUP NET LOCALGROUP |
See references in the Windows NT Resource Kit For example, Disabling Guest account: net user GUEST /ACTIVE:NO |
Personalizing: Creating shares |
NET SHARE RMTSHARE (NTRK) |
See references in the Windows NT Resource Kit |
Personalizing: Installing printers |
DRVMAN.EXE to install driver ADDPRINT.EXE to set up print share |
For example: c:\batch\DRVMAN install "HP LaserJet 4" d:\i386 For example: c:\batch\ADDPRINT "HP LaserJet 4" "STAMPANTE-RADAR" "HP LaserJet 4" LPT1: winprint raw |
Personalizing: Account policies |
NET ACCOUNT PASSPROP (NTRK) |
For example: C:\winnt\system32\net accounts /MAXPWAGE:90 /MINPWLEN:8 /UNIQUEPW:3 /DOMAIN For example: PASSPROP /COMPLEX |
Personalizing: Setting trust relationships |
NETDOM (NTRK) |
See Knowledge Base article 175025, Title: How to Build and Reset a Trust Relationship from a Command Line |
Personalizing: Adding rights to users |
Use NTRIGHTS.EXE by G. Zanzen |
For example: NTRights +r SeServiceLogonRight -u BNAdmin NTRights +r SeServiceLogonRight -u Supervisor NTRights +r SeServiceLogonRight -u TESEO_DOM_CENTR\BNAdmin |
Personalizing: Removing OS/2 subsystem |
DEL ..\System32\OS2ss.EXE |
For example: del c:\winnt\system32\os2ss.exe |
Personalizing: Removing POSIX subsystem |
DEL ..\System32\PSXss.EXE |
For example: del c:\winnt\system32\psxss.exe |
Microsoft TechNet
April 1999
Volume 7, Issue 4