Windows XP on a USB stick

Windows XP installation from USB

I wrote this piece back in March 2006 before transferring it to my new blog. It’s quite possible that bits and pieces of this HOWTO are outdated. If any are and you find a solution, then please leave a comment for the rest of us.

— Roderick

What follows is a recipe on how to install Windows XP from USB. You can cut right to the chase or read about how it happened to me first. Sit tight, you’re in for a ride!

Case In Point

You’ve got this Acer laptop with a malfunctioning DVD drive. Specifically, you removed it from its bay and now Windows XP crashes when you plug it back in. Knowledge Base article 310664 matches it to a tee.

Provided solution: update to Service Pack 1, or disable DMA in the BIOS. Current situation: running SP2 and blessed with a “user-friendly” BIOS that doesn’t allow you to disable DMA.

Your luck just ran out, but – being the geek that you are – you don’t whine about it. Instead, you come up with this bright idea: let’s install Linux, that’ll work some magic! And so you get Gentoo Linux installed using a home-bred LiveUSB distribution. And much to your dismay, no proper hot-plugging implementation is provided for your laptop. Curses.

So finally, you call the support line to have them collect your laptop for repair. One problem here: you’re betting they won’t like seeing Linux boot up and, hoping to forego service costs, it’s up to you to reinstall Windows XP.

One problem here: you don’t have a working CD-ROM drive to install Windows XP off, and from experience you know that Windows XP won’t install from an external drive. Blasted!

Enter the cavalry.


The procedure here is provided without any warranty or support whatsoever. It worked for me and so it might for you. It also might blast you and your laptop to pieces. Some of the procedures described here can wipe all of your data. Thought I’d warn you.

I don’t mean to be inventive here, either. In fact, all the technology has been laid out for us and is readily available. All I’m doing is wrapping it all up in writing. Shouts out to everyone who provided the technology!

That being said, let’s get down to business.

Ground Zero: Ingredients

You’ll be needing ample space on a USB storage device like a thumb drive or external disk drive. 1 GB of storage will suffice. Possibly, you could access the setup files from a network share in which case you’ll only need a 256 MB thumb drive, but I haven’t tried that.

Personally, I booted off a 512 MB thumb drive and put the Windows XP setup files on an external disk drive. So a combination will do just fine, but just make sure that you’ve got enough USB ports: all USB devices will need to be plugged in and stay plugged in while we’re booted into BartPE later on!

You’ll also need a bunch of software, including a valid copy of Windows XP. The other software components can be downloaded freely:

Q: Why Windows 2003 Server Service Pack 1? I want to install XP!

A: Well that’s exactly the trick, though it’s a bit technical. During booting, Windows resets the USB port and loses your boot device. That’s why installing from USB normally fails. But by using Windows 2003 Server’s ramdisk feature in the early phases of booting, we avoid that problem.

Don’t be mislead though: you’ll be installing Windows XP all the same. It’s just that we’ll be using two Windows 2003 Server files from the Service Pack to do it.

You can also do a Windows 2003 Server installation using this same procedure, save that you’ll be needing to update to Windows 2003 Server Service Pack 1 instead of Windows XP SP2, below. That’s assuming, of course, that you’ve got a valid copy of Windows 2003 Server.

You will also need an already functional Windows system to prep the USB disk from. In addition, your target system (the one that needs reinstalling) should support booting from USB. Virtually all modern ones do though.

Finally, not all cheaper USB devices properly support being booted from. The BartPE forums have a partial list of ones that don’t.

Step One: Preparing the Windows XP Setup Files

For this procedure to work correctly, you’ll need Windows XP to be at Service Pack 1 or Service Pack 2. Many newer Windows XP CDs already have either one included.

You can check by inserting the CD-ROM and looking at the files in the top folder. There should be a file named WIN51P.SP1 or WIN51P.SP2. If you see either one, fast forward to step two.If there is no such file, or you’ve got a SP1 CD that you would like to update to SP2, proceed as follows:

  1. Copy the Windows XP CD-ROM to a location on your hard drive. We’ll be assuming C:\winxpcd. I strongly recommend you to use such a vanilla CD. Users have reported strange happenings with custom XP distributions.
  2. Download the Windows XP Service Pack 2 Network Installation Package.
  3. Unpack Windows XP SP2 by running WindowsXP-KB835935-SP2-ENU.exe -x. Note the -x parameter that will allow you to specify a location to unpack to. We’ll be assuming C:\winxpsp2.
  4. Integrate SP2 into the setup files by running C:\winxpsp2\i386\update\update.exe /integrate:c:\winxpcd.

If your system needs special drivers to run, this would be the time to include them (called “slip-streaming”). Doing so isn’t exactly trivial and should only be necessary if you, say, need non-standard SATA support. The process is beyond the scope of this article, but fortunately Google is your friend.

Step Two: Prepping BartPE

First we’ll prep the USB drive we’ll be using for booting. This is by far the largest step in the process, though it shouldn’t be difficult for anyone to follow. It requires a functional Windows system.

  1. Install BartPE. We’ll be assuming that you install to C:\pebuilder.
  2. Unpack PE2USB to C:\pebuilder.
  3. Unpack Windows 2003 SP1 by running WindowsServer2003-KB889101-SP1-x86-ENU.exe -x (that’s assuming that you downloaded the English version). Note the -x parameter that will allow you to specify a location to unpack to. We’ll be assuming C:\server2003sp1.
  4. Create a folder named C:\pebuilder\srsp1.
  5. Copy C:\server2003sp1\i386\setupldr.bin to C:\pebuilder\srsp1.
  6. Expand and copy ramdisk.sys by running expand -r C:\server2003sp1\i386\ramdisk.sy_ C:\pebuilder\srsp1.
  7. Start PE Builder from the Start Menu. Point “Source:” to the location of your Windows XP setup files containing SP1 or SP2.
  8. Make sure the “Output:” is set to “BartPE”. If using SP2: go into the Plugins configuration dialog and enable “RpcSS needs to launch DComLaunch Service First – SP2 only”.
  9. Hit “Build”.
  10. When it’s done building, insert the USB drive you intend to boot from and run C:\pebuilder\pe2usb -f [drive:], replacing [drive:] with the location of your USB drive. This will destroy any data on your USB drive! The drive shouldn’t be partitioned any larger than 1 GB. If it is, then repartition it using Computer Management in the Control Panel.
  11. Copy the Windows XP setup files to the USB drive (or another USB device if you have insufficient space left). You’ll only need the i386 folder.

If no errors occurred in the process, you should now be all set to boot from USB!

Note: it’s possible to use Windows 2003 Server as the operating system to boot from, but I don’t recommend it. Many of BartPE’s included utilities won’t work properly.

Step Three: Configuring the BIOS

You should now reboot and go into the BIOS configuration to boot from USB. Instructions for doing so wildly from system to system, but generally entail the following:

  1. Reboot the system.
  2. While booting (before Windows starts loading), get into the BIOS configuration screen by hitting something like F1, F2, Delete or Escape. Hotkey instructions are generally provided on the screen.
  3. Go to the section that has your boot devices.
  4. With your USB drive plugged in, the USB drive should be listed. If it isn’t, your system might not support booting from USB. Assuming that it is supported (as happens with almost all modern hardware), promote your USB drive to the primary boot device.
  5. Exit from the BIOS configuration, saving all changes.

If you’re completely new to BIOS configuration, BIOS for Beginners over at Tom’s Hardware might be a good primer. Be aware though, that you can seriously screw up your system by providing incorrect settings!

Step Four: Booting into BartPE

Assuming that you properly configured your BIOS and your USB device supports booting, BartPE should now load. Depending on the speed of your USB device, this may take a while.

If it isn’t working, then double-check the following before making a scene:

  • Is your BIOS properly configured for booting from the USB disk? (Is the USB device listed and does it have top priority?)
  • Have you correctly prepared the USB disk in step two? (Restart the procedure.)
  • Does your USB stick properly support being booted from? (Try another one!)

Step Five: Prepping the Hard Disk

You need to make sure that your hard drive is partitioned and formatted properly. Especially if you’ve had Linux or some other operating system on it, you’ll need to repartition and format it. BartPE has DiskPart for disk partitioning and A43 File Manager to format your drive.

If you are sure that your hard drive is set up properly (i.e. it has only run Windows, it has a valid FAT or NTFS partition) then you can safe yourself the hassle and skip this step.

This procedure will destroy any data on the hard drive.

To repartition:

  1. From the Go menu, navigate to DiskPart.
  2. Enter the commands needed to repartition your drive. For example, try the following: select disk 0 (select the first disk), clean (purges the entire drive, essentially resetting it), create partition primary (creates a single partition from the entire disk), assign (assign the partition a drive letter), exit (quits DiskPart).

This procedure will destroy any data on the hard drive.

To format:

  1. From the Go menu, navigate to the A43 File Manager.
  2. Right-click on the target drive (e.g. C:) and click Format. Should be self-explanatory.

Step Six: Launching Windows XP Setup

With your drive all ready, you can now launch the Windows XP setup with a few custom parameters. Let’s assume that the files are available at D:\i386.

Plugging in a device now won’t work. Remember that all USB devices will need to be plugged in right from the start while using BartPE.

  1. Run D:\i386\winnt32.exe /syspart:C: /tempdrive:C: /makelocalsource. Replace C: with the drive you want to install Windows to.
  2. Proceed with the installation. When asked to convert the installation volume to NTFS, answer No. The setup program incorrectly believes that your USB drive (which is formatted as FAT) needs conversion.

The setup program will then silently close, which might make you think that something went wrong. Don’t worry though. Reboot your system, remove the USB drive(s) and – if all went well – you can now finish setting up Windows XP. Congratulations!

513 thoughts on “Windows XP installation from USB”

  1. Roderick, it works like a charm! Thank you very much!

    PS: Also an old laptop with a broken cd-player, crashed HDD(replaced it), broken mousepad and a battery that died many years ago. Think i’m still gonna use it for some oldscool gaming ^^.


  2. Quite a job, but indeed works perfect!

    If DiskPart seems not to run (i.e. you don’t see a command window popping up), run it from a command prompt. You may see the following message: “The disk management services could not complete the operation”.
    In that case, run the following two commands from the command prompt:

    net start dmserver
    net start dmadmin

    Then run DiskPart

  3. saved me a ton of time thank you for this, for anyone trying to install xp from usb on a acer revo nettop make sure you turn off the acer quickboot and switch the drive compatability from sata in the bios otherwise it wont work

  4. Thank you for your work. I did have an issue where winnt32.exe did not get copied to the USB drive, but I was able to use a USB Dvd drive and just change the drive letter in step 6, which then copied the files directly from the actual CD. This was on a Dell Inspiron B130. Can’t say how much it has helped tonight!

  5. Awesome tutorial! Worked a charm.

    I had Thinkpad x301 with Ubuntu Karmic already installed and no inbuilt CD drive.

    Used Gparted to resize my existing Ubuntu disk and create a new primary ntfs disk.

    Had to put SATA into compatibility mode in the BIOS for BartPE to see my hard disk.

    Had same issue as Cadu above – after launching setup no NTLDR boot loader yet, so booted back into Ubuntu.

    Ran grub-update and it found the XP loader. Rebooted, used GRUB to continue installation and all went well.

    To get GRUB back afterwards, just used a Ubuntu startup disk (usb) to boot back into my system and reinstall GRUB. Instructions here: – see section on reinstalling GRUB.

    Note: the usb startup disk failed to load the disk driver on boot. If this happens for you and you can’t see your hard disk, try reloading the driver:

    sudo modprobe sata_via

    This worked for me.

    Once GRUB was reinstalled, ran update-grup (note: not grub-update) and good to go.

    Thanks for the tutorial!

  6. For those experiencing “operating system not found” errors, try using diskpart to set the partion on the usb pen as active

  7. Thanks for the guide, it’s been really useful! The hardest part was partitioning a 2Gb usb stick down to 1Gb.

  8. I have no boot menu on my laptop.
    And installation Windows 7 DVD was scratched.
    What i did was:
    1) download windows 7 installation ISO;
    2) unpack it on flash drive;
    3) boot from any installation CD/DVD (just to get close
    to command promt);
    4) format c:;
    5) copy contents of flash drive to c:;
    (xcopy f:*.* c:);
    6) reboot.
    The PC will boot from c: as it was some DVD and will actually install Windows on itself.

  9. the design of the MSI Wind is similar to the basic netbooks you can find around. the price point of this netbook is cheaper than acer or dell netbooks *

  10. Must be very satisfying to be still getting feedback and interest in this article. I found it because my problem was identical to the scenario you describe at the top. Thank you for your efforts!

    It took a few tries to get it working, but once I got an error free compile from BartPE it worked beautifully.

    Question: have you tried replacing bartpe.iso with different boot images (acronis, Techie Toolkit, hell just about any bootable image)? I tried messing around with the tif file but it seems that BartPE uses Windows shell extensions to load its environment so when I replace bart with something else I get errors….

    Just kinda thinking out loud. Thanks again for your tutorial.

    Pete Franke

  11. Thanks Roderick!
    And thanks Serpeal for documenting a fix in the comments.

    A recap of Sepeal’s comments:
    If you successfully boot BartPE on your target computer but the when you type “select disk 0” into diskpart it says there is no disk, do the following:

    1.) Try changing the SATA setting in your BIOS to “off” or “IDE”
    If this doesn’t work try step 2 below.

    2.) Follow this guide:
    copy DP_MassStorage_wnt5_x86-32_901.7z into your C:\DPsBase\DriverPacks directory, DON’T UNCOMPRESS IT, to successfully get to figure 2 in the guide.

    Finally, redo Rodericks guide from step 2.7.
    Worked for my Acer Aspire One 532.

  12. This works great. I actually did it for the first time a good few months ago.

    Then I formatted the USB drive (but backed up the install/boot disk files) and decided to install Windows 7 from USB.

    Then I needed to install XP again. I was a bit worried that I might have to re-do all these steps since the drive had been formatted.

    All I had to do was copy the backed up files back onto the USB stick and it worked!

    I believe its because to install Windows 7 I had to create a boot sector on the drive which works for the XP install as well. Although the steps were different, the end result is the same.

    This is a great guide. Once you stick with it (took me an hour or two the first time), you can install XP whenever you want and on almost any machine.

  13. lol, you seem to have a growing love/hate relationship with your readers!

    Thanks for the reply, though I quickly discovered that I do not have a good grasp of how to configure/edit an application INF 🙂 I guess Ill be doing some additional research before I use BartPE to launch custom plugins. But the process is intellectually engaging, so thanks for the links!



  14. Those who persevere will conquer…

    when kept accurately to every step in this walkthrough it work perfectly!!!

    Thank you very Much!

  15. This was an awesome guide! I had a few snags, that with help from Google and my own years of technical support knowledge I was able to iron out. Otherwise this was the best guide I have found!

    Kudos to you!

  16. i want to make a bootable usb with recovery console inside!
    how to make it, i try a lot with different techniques and nothing happened….

  17. hi

    instep 2

    1.install BartPE. We’ll be assuming that you install to C:\pebuilder.
    2. Unpack PE2USB to C:\pebuilder.

    what meaninf of numbe step, unpack pe2usb?

  18. Hey Roderick. Great job. I’ll be keeping this little gem as long as I can. Does require a bit of electronic finesse, but anyway with some basic pc knowledge can do this.
    If I ever meet you I’m buying you beer.

  19. is not working for me either.. wat do u mean by “Expand and copy ramdisk.sys”? is not a rar file….

  20. this tutorial works great with windows xp professional sp3 (using the same instructions as sp2). Thank you so much! I needed this!

  21. Hi,
    Great post though…
    I hav got an error while trying to install win-xp from USB Drive.
    “Setup cannot finf the End User Licensing Agreement (EULA)”
    Please let meknow where i am doing mistake….
    Thanks in advance….

  22. I will also recommend flashboot . Tried BartPe multiple times but it never go to booting the system. Flashboot (trial) worked out of box. Process was simple click and go!

  23. After many many Internet searches, I finally found this post which solved my problem. Super thanks!
    Only few comments:
    1. It workes with SP3 as well. It is possible to integrate the original CD-ROM with the latest SP version only. So, it is not necessary to integrate either with SP1 or SP2.
    2. The “FILE \I386\SYSTEM32\NTOSKRNL.EXE failed to load. The error code is 14. Setup can not continue” error message has been shown only with SP1. With SP2 and SP3, it was allright!
    3. It was not necessary to have the USB drive repartitioned into peaces smaller than 1GB. It worked for me with an 4GB USB flash.
    See you!

  24. Hey great tutorial,

    Some things didn’t go as expected through this here was my solution.

    1. Build you bartPE directory as above
    2. Use PE2Usb (The GUI version) to set up the boot sector and copy over the files (seems the DOS version was having issue doing this correctly and producing the ‘Remove Media’ error message)
    3. Copy over the I386 directory of your windows installation and then continue with the remainder of the tutorial with installing windows.

    Just my 2 pence 🙂

    Thanks Again

  25. i have a problem on my laptop it is dell D600
    i have to run the setup from a pendrive as my cd rom does not work
    so would u plese tell me how i can do that

  26. Hello!

    A tip for a problem I ran into:

    In pebuilder.log I had this error: “Error: DeleteFile() “C:\pebuilder\BartPE\i386\system32\setuphiv” failed
    Error: DeleteFile() “C:\pebuilder\BartPE\i386\system32\setuphiv.log” failed”

    Also when running pe2usb, the process stopped with mkfsiso error, it couldnt access setuphiv file. I looked at setuphiv with Unlocker and it was used by two thread. I couldn’t unlock then with Unlocker tool.

    After restart, pe2usb worked without errors.

  27. Excellent guide. Only issue I ran into was the error: “expand: invalid option –r” when attempting to expand the ramdisk.sy_ file. I just opened it with WinRar instead and extracted it to the correct folder and everything ran smoothly. I have tried many guides to re-install WinXP on my netbook via USB and this is the only one that has worked.

  28. Yo!
    Thanx for a phantastic description and easy to use program. Installed XP SP2 with a 1Gb Flashdrive on a Dell D410 which doesn´t have any CD/DVD reader.
    Lots of respect from Sweden !

  29. Installing now. Ruined my saturday and sunday though, needed some tries.

    Nevertheless, excellent guide and thnx for the help!

Leave a Reply