You can choose from several different XP installations by placing each i386 XP CD source folder into a separate folder on the USB drive and installing the one that you want onto the target hard drive.
Outline of the this Method
1. Download and install the Windows 7 WAIK to obtain the ImageX utility and WinPE files
2. Obtain a Microsoft Windows XP installation CD or ISO or set of NLited files that you wish to install
Create a new folder on your Windows (office computer) hard disk called C:\MYXP\XPPRO\i386 (assuming you have XP Professional)
Copy all the files in the CD's i386 folder to C:\MYXP\XPPRO\i386 folder
Ensure that the file C:\MYXP\XPPRO\i386\unattend.txt is present and has been correctly modified by you (see end of this page for an example)
Note: XP does not contain AHCI or some SCSI/SATA drivers - either you must set your BIOS menu for Hard Disk mode to 'compatible/legacy' hard disk mode or you must use a specially modified version of XP (e.g. use nLite).
Now prepare a WinPE v3 (bootmgr) bootable USB drive using RMPrepUSB and copy over the C:\MYXP folder to the USB drive - please refer to the part 2 of my tutorial here. Note: NTFS formatting is recommended for speed.
The USB drive should now contain an \XPPRO folder as well as the winpe folders: \sources, \boot, etc.
3. Boot from the WinPE USB drive using the target system that you wish to install Windows XP onto.
Now run DISKPART and type the following commands (assuming you want a two partitions on the hard disk) - only type the commands in red:
DISKPART run diskpart utility
LIS DIS lists the disks present
SEL DIS 0 select disk zero (usually the first hard disk)
CLEAN wipes the selected disk
CRE PAR PRI SIZE=30000 ALIGN=16065 create a 30GB primary partition for XP (change as required) - if this gives an error use 64260 instead of 16065.
FOR QUICK LABEL=SYSTEM format it as NTFS (add FS=FAT32 if you don't want an NTFS partition)
ASSIGN LETTER=J assign it the drive letter J:
ACT make it the boot partition
CRE PAR PRI create another NTFS partition of remaining size (optional)
FOR QUICK format it (optional)
ASSIGN assign it a drive letter (optional)
LIS VOL list volume letters
EXIT quit diskpart
you now should have a formatted hard disk ready to receive files.
5. Now you need to run winnt32.exe from the drive containing the source i386 folder (e.g. if D: is the USB drive) to start the copy of the XP install files to the hard disk as follows:
(thanks to João Santos for the tip of adding /makelocalsource!).
To install a different XP source - e.g. D:\XPHOME\i386 or D:\XPPRO\i386 just change the winnt32.exe path accordingly.
/makelocalsource - Instructs Setup to copy all installation source files to your local hard disk. Use /makelocalsource when installing from a CD to provide installation files when the CD is not available later in the installation. The i386 files will be taken from the same folder that winnt32.exe is located when it is run.
5. When the setup phase completes and returns you to the command line you can reboot by typing:
Now remove the USB drive and allow the target PC to boot and start the textmode 1st setup phase. Note that unless you have added AHCI drivers (or press F6), the BIOS must be set to IDE (compatible) mode or you will get the dreaded BSOD 0x0000007b error!
TIP: The XP files are many and the file copy is thus quite slow (and very slow if using FAT32 on the UFD). You can speed this up by using 7zip instead of a file copy. Just zip up the XPPRO folder and place the zip file on your USB drive instead of the XP I386 files, then extract the files to the hard disk using the 7zip e or x option. You can also extract a zip file from a network as pulling a zip file across a network is a lot less data than pulling over all of the i386 files and therefore much faster! Remove the /makelocalsource switch if you do this.
Tip: You can easily automate the steps from 3 to 6 - e.g.
diskpart /s dp.scr
xcopy /herky \XPPRO\i386\*.* J:\i386\*.*
winnt32 /unattend10:J:\i386\unattend.txt /syspart:J: /tempdrive:J: /s:J:\i386 /noreboot
echo Finished - please remove your USB drive now!
where the file dp.scr contains the diskpart commands in step 3 (except for the first DISKPART line, of course).
WinPE has networking
The i386 files do not need to be on your USB drive, they can be on any networked computer. Just create a shared folder on your 'office' PC (or server) - right-click on the C:\MYXP folder and choose 'share with' to share it out.
The WinPE USB drive will need to have the correct network drive for the target system.
To install the correct network driver when you have booted to WinPE from your USB pen, type DRVLOAD F:\WIN7DRIV\xxxxx.inf where the USB drive folder F:\WIN7DRV contains the correct win7 driver files (.inf, .sys, .dll, .cat etc.) for your hardware (wait a minute or so afterwards for networking to start up). Now connect to your networked shared folder on your office PC using the command:
and then type in your password when prompted.
Now dir N: should list the contents of the MYXP folder on your office computer. So you can now install any XP image across the network and you don't need the XP files on the USB drive at all, just change the XCOPY source folder in the example above to point to your N: network folder.
Another tip is to back up the XP install once it has finished installation. Then you can easily and quickly restore your XP install at any time in the future - see Tutorial #1 for details!
SAMPLE UNATTEND.TXT FILE FOR UK
;Driver INF files placed in the following folders will be automatically installed
OEMPnPDriversPath = "Drv\Net;Drv\Audio;Drv\monitor;Drv\Storage;Drv\Video;Drv\Mbd;Drv\Modem;Drv\Misc"
OrgName= "Ted plc"
;put your product key on the next line or delete the next line
BitsPerPel = 16
XResolution = 800
YResolution = 600
VRefresh = 70
BrandIEUsingUnattended = No
IEBrandingFile = install.ins