You are currently offline, waiting for your internet to reconnect

How to Customize a WinPE Startup Process for Windows XP Deployments with the Diskpart Utility

Support for Windows XP has ended

Microsoft ended support for Windows XP on April 8, 2014. This change has affected your software updates and security options. Learn what this means for you and how to stay protected.

This article was previously published under Q303906
This article has been archived. It is offered "as is" and will no longer be updated.
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.

Automating Diskpart

To automate a WinPE boot and a repartition with Diskpart, and to initiate an install of Windows XP:
  1. 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.For example:
    regsvr32 /s netcfgx.dll
    factory -minint
    netcfg -v -winpe
    net start dhcp
    net start nla
  2. 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):
    diskpart /s delpart.txtecho Y | format c: /v:Syspart /fs:ntfs /q echo Y | format d: /v:Sysdata /fs:ntfs /q net use x: \\Server\XPShareX:\XPPro\i386\winnt32.exe /syspart:c: /unattend:X:\XPPro\unattend.txt /s:X:\XPPro\i386"exit					
    NOTE: You must use the parameter /syspart:c: for Setup to start successfully.

  3. 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:
    Select disk 1cleancreate partition primary size 4096assign letter cActivecreate partition extended create partition logicalassign letter dExit					
    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.

    Typically, when these files are configured, the WinPE source files are used to create a startup CD-ROM.

Article ID: 303906 - Last Review: 12/06/2015 04:05:56 - Revision: 2.3

Microsoft Windows XP Professional x64 Edition, Microsoft Windows XP Home Edition, Microsoft Windows XP Professional

  • kbnosurvey kbarchive kbenv kbhowto kbsetup KB303906