This article describes how you can customize the Windows Preinstall Environment (WinPE) to perform customer-automated tasks at the startup of WinPE.
In WinPE, you can use the Diskpart.exe utility to manually process the cleaning of an entire hard disk (or hard disks), or the deletion or creation of new partitions prior to initiating an install of Windows XP.
To automate a WinPE boot and a repartition with Diskpart, and to initiate an install of Windows XP:
- Edit the Startnet.cmd file in the I386\System32 folder of the WinPE source files and add a Formatbat.cmd entry to the end of the file.
NOTE: This step is performed when the WinPE source files have been copied from the CD-ROM to a Flat folder for customization.
regsvr32 /s netcfgx.dll
netcfg -v -winpe
net start dhcp
net start nla
- Create a file called Formatbat.cmd and place it in the I386\System32 WinPE source folder with the following text (this step calls the Diskpart script to create two partitions in this example, and then formats them and initiates Windows XP Setup):
NOTE: You must use the parameter /syspart:c: for Setup to start successfully.
diskpart /s delpart.txt
echo Y | format c: /v:Syspart /fs:ntfs /q
echo Y | format d: /v:Sysdata /fs:ntfs /q
net use x: \\Server\XPShare
X:\XPPro\i386\winnt32.exe /syspart:c: /unattend:X:\XPPro\unattend.txt /s:X:\XPPro\i386"
- Create a file called Delpart.txt and place it in the I386\System32 WinPE source folder with the following text. This step creates the partitions, a primary partition that uses 4,096 megabytes (MB) of disk space; assigns a drive letter (C:) and marks it as "active", creates an extended and logical partition by using the remaining space on disk 1 and assigns the drive letter (D:), and then exits back to enable the next command in the Formatbat.cmd file to process or proceed with formatting both of these partitions as NTFS as well as initiate an unattended install of Windows XP from a network share:
The preceding step can be made to initiate an "unattended sysprep factory install" when the partitions are created: The primary partition is marked active or assigned drive letters and formatted.
Select disk 1
create partition primary size 4096
assign letter c
create partition extended
create partition logical
assign letter d
Typically, when these files are configured, the WinPE source files are used to create a startup CD-ROM.
Article ID: 303906 - Last Review: December 1, 2007 - Revision: 2.3
- Microsoft Windows XP Professional x64 Edition
- Microsoft Windows XP Home Edition
- Microsoft Windows XP Professional
|kbenv kbhowto kbsetup KB303906|