(How To) Install Windows XP, Vista, 7 and Ubuntu from Pen-drive

This tutorial will teach you how to install Windows XP/Vista/7 or Ubuntu/Linux from pen-drive. Basically, you can create a bootable USB flash drive and use it like a bootable CD/DVD.
Why would anyone want to install Windows XP from a pen drive?

install windows xp from pen drive

Install windows xp from pen drive

  1. May be their CD drive isn’t working properly like mine, or
  2. They don’t want to waste money on a CD

More over installation from a flash drive is faster compared to a CD.
Before we go on with the tutorial here’s what you’ll need

  1. 1 USB flash drive, 1GB or larger
  2. 1 Windows XP installation disc
  3. Assorted files that I’ll describe as we go along.
  4. Note: Your BIOS should support USB boot, some older computers may not support USB boot.

Preparing the flash drive
First up, we need to prepare the flash drive.

  1. Download and unzip this file, which should contain 2 folders: 1 titled Bootsect, and the other USB_prep8.
  2. Navigate to the USB_prep8 folder and click on usb_prep8.cmd. This will bring up a Windows console window.

    Making a bootable USB

    Making a bootable USB

  3. Press any key to continue and a PeToUSBwindow will open.

    Image for step 3, click to enlarge

    Image for step 2,3 & 4, click to enlarge

  4. Make sure your flash drive is selected, and click start to format your flash drive.
  5. When the format is complete, click OK, but do not close the PeToUSB window or the Windows Console.
  6. Open a new console window by typing “cmd” into the run box in the Windows Start Menu.
opening Command Prompt

opening Command Prompt

  1. Find your Bootsect folder (if you’re not used to DOS commands, you can type “dir” to list directories and files, type “cd folder name” to navigate to a folder name – called foldername in this example, and if there’s a long folder name you can save time by typing the “cd” and just the first few letters and then hitting the Tab key to fill in the rest of the name).

    Changing directory on a command prompt

    Changing directory on a command prompt

  2. Once you’re in the Bootsect folder, type “bootsect.exe /nt52 g:” if “g” is the letter assigned to your flash drive. If it’s E, then change the letter to e. If it’s Z, make it z. Get it?
  3. When this is done, you should see a message letting you know that the bootcode was updated, and you can close this console window (but not the other console window).
  4. Close the PeToUSb Window, but make sure not to close the remaining console window yet
  5. You should now see a list of 8 options in the console.
  6. Select one and find the drive with your Windows installation disc.

    Making a bootable USB

    Making a bootable USB

  7. Select 2 and pick a random drive letter (but not one that’s already on your PC, since this will be a virtual drive used for copying your files).
  8. Select 3 and enter the drive letter for your USB flash drive.
  9. Select 4 and follow the rest of the on-screen directions and you should be all set.

The process should take about 15-20 minutes. When it’s done, you should have a bootable USB stick that you can use to install Windows XP the same way you would if you had a CD/DVD drive.
A few notes here. First of all, there’s a chance you may get down to step 15 and the program will tell you that it can’t create the virtual drive. This may happen if you’ve already gone through the whole process and are trying to do it again to fix problems. The solution seems to be rebooting your computer and trying again. Or at least that’s what worked for me.
Second, if you use NLite to shrink/slipstream/otherwise modify your Windows XP installation file, make sure you do not remove “manual installation files,” or your USB stick will be pretty much useless.

Once your USB drive is ready, go to your bios and set USB to first position in boot order. Now plug the USB and restart.

Make sure you back up your important documents and files, Firefox bookmarks, and drivers if you lost your drivers cd.

This post explains you how to back up your drivers easily

Driver Genius | Create a one click installer combining all your drivers.

Creating a bootable Ubuntu/Linux pen-drive:

Creating a bootable ubuntu pen-drive is pretty easy

  1. First copy the iso file of the linux version you want to install on to your hard drive.
  2. Download unetbootin from http://unetbootin.sourceforge.net/
  3. Then double-click the unetbootin file.
  4. This will open up a small window, select disk image and browse to the image on your hard drive and click ok.
  5. You bootable pen drive should be ready in 5 to 10 minutes
Creating a Ubuntu bootable pen drive with Unetbootin

Creating a Ubuntu bootable pen drive with Unetbootin

89 thoughts on “(How To) Install Windows XP, Vista, 7 and Ubuntu from Pen-drive

  1. ashish dhanesha says:

    really good job I made it for windows xp but my questation I wan’t both installation windows xp and windows 7 then how to create windows 7 installation from same pen drive help me please

  2. Really Nice Work, I was not knowing that we can install from pendrive too.
    Amazing

  3. really good work.. :) thnks for the great share ;)

  4. This is where I first learned to reinstall windows thank you

  5. good nice work
    working thanks………..

  6. At present time i am using in window 7 in dell insprion n_5010
    and i want to install in window xp show please tell me about
    and how to make pendrive boot in window xp in window 7 platfrom

  7. Er.Brajesh Dixit says:

    It’s cooland good I love it…….

  8. your programs and data in tact, but need to restore the Windows XP system files to their original state.

    A Windows XP repair install is often an easy fix for startup and other hard to troubleshoot issues in Windows XP. It’s best to install Windows XP this way before you resort to a clean install.
    http://www.techyv.com/questions/how-install-windows-xp-0

  9. i am using win 7 os .when i m opening usb_prep8
    so it is showing “no usb disk
    found”. but pen drive(moserbear 2gb) is already
    attached………plz tell me y it’s happening……..is there any vendor
    specific…?

  10. after the proceedure of bootsect completed as u said….

    Press 1 on your keyboard — this will bring up a window. Locate your XP folder and highlight it. Click OK

    so when i press 1 to locate xp folder and highlight it…… an error pops up…..

    error:the path cscript error: [can't find script engine "vbscript" for script "c:\usb_prep8\u_script\foldersel.vbs".]

    so what to do in this situation….help me guys…plzzz i m in middle of somthing……thanks and regards

  11. sorry to say buddy but that trick of yours is pretty much useless with Windows 7.

    reason: you see ‘at step 12′ the tools of yours don’t recognize windows7 install files as vaild ‘windows xp source files’.

    request: please remove ‘windows 7′ from the misguiding title of this article.

    thanks.

  12. thanks it’s greatfull………………………$$

  13. i hv not try yet.

    but after seems to be read, it’s a wonderful exoerience for me

  14. Thanks for this good information

  15. does it work for xp sp3??????

  16. when i clickes on boot option of usb a blue screen apppears showing default what shud i type there

  17. you must try “A bootable usb” or “Novicrop win to flash” software to do so

  18. Kapil Mavani says:

    HI i have tried with the given setp but i stuck at step 4, where system could not detect the pendrive. Can you pls help me?

  19. hi, all above is successfully done but at the time of installation i m facing same problem “hal.dll” file missing or corrupt.
    how can i solve it

  20. after creating the bootable usb,i tried to instal the OS.But it shows so many files missing……hw to slove this problem nw?

  21. Govind Bisht] says:

    yeah, it working
    I made my pendrive bootable and install xp through it.
    thnx for this.

  22. [...] I found a really helpful software called WintoFlash, this software was recommended on every site and it showed me how to create a bootable flash drive with just few clicks. There is another method you can check it out here. [...]

  23. I do not have a hard disc in my PC. CD-ROM is working and I have Win XP SP2 installation CD. I want to utilize my 4 GB pend drive as hard disk. Can I install win XP SP2 in my pen drive? Whether my system will boot properly. My BIOS shows that it can boot through USB-HDD. Plz suggest.

  24. Abdus Saboor Ansari says:

    HI ! every one i have tried all the procedure and finally got to complete it but when i boot from the USB it says ” problem “hal.dll” file missing or corrupt. ” the same problem i guess with was of NARESH … any suggestionx ???

  25. THANK YOU SO MUCH!!! It works! Much effective than wintoflash!

  26. hi, i want to re-install windows on my laptop, accidentlly i deleted the partitions of fedora on my laptop, which was earlier a dual boot,thinking that i can use one kernel. Now it takes me to the GRUB interface. How do i get back to windows??

  27. [...] this Illustrated walk-through: Creating a bootable USB flash drive for Windows XP | TechRepublic How To install Windows XP, Vista, Windows 7 and Ubuntu through pendrive How To make Bootable USB Creating a bootable USB flash drive to run Windows XP " It is so [...]

  28. i have used it already but it was written that u can install XP in C: drive only.
    Is it possible to install Xp in other drive partitions(D:,E: or……) too or nt
    pls reply ASAP

  29. I have used it
    It works perfectly for WinXp SP2

    Thanks for a good tutorial

  30. when i m opening usb_prep8 so it is showing “no usb disk found”. but pen drive is already attached………plz tell me y it’s happening……..is there any vendor specific…?

    • Did u extracted or unzip first before u opened that file? if not try extract it first

    • Hi.. Vasu
      You didn’t tell what kind of OS you are using. It’s working in Win XP SP2 in perfect manner. If your OS is higher than XP please download support files related to your OS.

  31. josiefruit says:

    Hello Satish,

    I found an empty 1gig flash drive so I tried to make a windows xp bootable usb, with your guide I successfully created one. So thank you so much.

    I’ll try this one next week if it will successfully install the OS on my pc. Again, thank you for your clear instructions. *wink

  32. After complition of xp bootable flash drive when I install xp from it
    its boot & copy windows installation file but after that at windows starting screen fatal error is appear error is unable to reed from the source may be virus or scandisk for f:

    Please help why it is hppen.

  33. hi, all above is successfully done but at the time of installation i m facing same problem “hal.dll” file missing or corrupt.
    how can i solve it

    is there any possiblities that download hal.dll and paste it in bootable USB.???? if not please help me out with the best solution.

    • i tried to do this some days back and got same error and surprisingly when i again boot through usb it shows only 1 partition(in have 4} so i dropped the idea…as my cd drive is not working…n thought of taking it to some repair shop…then one day i came across a sol…here it is..it worked for me—-
      1.insert the usb and start pc
      2.press f8 or whatever key u do to get a boot option menu–where it only show devices from which you can boot as in labtops and not enter into bios.its important.
      3.select usb and boot
      4.you will now see same two option by which you intalled xp.select first option and it will take you to the installation process and intall keyboards,start menu etc and you will see welcome screen….u done it by now
      5.afder next reboot ,you will see 2 options to select.first will be win xp professional and second will be regarding usb that says do not select this option.
      and so after many hrs of fatal hal.dll missing and cirrupt i again using xp…
      thanks

    • You must try using “A bootable Usb” or “Novicrop win to flash” software to create a bootable usb

  34. i tries this method but it shows hal.dll file is missing or corrupt can anyone tell me how to solve this problem

  35. after the first step of intallation frm text mode wen it restarts again n i press gui mode it says “hal.dll” file corrupted…plzzz help

  36. No script engine associated with .vbs fix:
    Replace all instances of “CSCRIPT.EXE” with “CSCRIPT.EXE //E:vbscript” in usb_prep8.cmd and Mount_TempImage.cmd. :)

    To resolve the missing hal.dll, read this thread:
    http://ubuntuforums.org/showthread.php?t=461084

    The answer is covered in detail there. Edit boot.ini and set the correct drive and partition.

  37. i install xp successfully
    but when i am going to install office 2007 it give error
    please check it out and reply me a solution on it
    thank you

  38. Hi,

    When i tried to follow the above steps i stuck at PeToUSB. My Pen Drive is not getting listed though it is visible in My Computer as well as i can access the same, but not able to go on your steps.

    I also tried changing the pen drive but the problem still exists.

    Can you please help me with some solution.

    Thanks in Advance.

    Regards,
    Jatin

  39. Fathima — Run the command prompt as administrator…

  40. files copied on flash drive but while we installing its detecting C: for flash drive.
    please revert back.

  41. nice……… tutorial.. thank u!

  42. thanks for this help this iadea is working for me thanks a lot

  43. Thanks a lot for your help. It really worth an information.

  44. pl help me this prosisar is nt wrking in my pc…..!

  45. I use “Novicorp WinToFlash” for Win xp and “unetbootin” for linux ……

    anyways…..thanks for sharing… :)

  46. hi don…could you post instructions on how you were able to accomplished putting xp and ubuntu installer on a single drive…i want to create a single usb for installing xp, win7 and ubuntu in my 8gb flash drive…thanks in advance…

  47. after the first step of intallation frm text mode wen it restarts again n i press gui mode it says “hal.dll” file corrupted…plzzz help

  48. i know this .i do many times……….

  49. Cool instructions…is there any way to get XP and the Ubuntu ISO on the same USB stick with a grub4dos menu or something? I’d like to create a single stick with bootable XP, Ubuntu Live, UBCD, and other stand-alone bootable tools. I can do everything on one USB stick using MultiBootISOs except for the stand-alone XP OS. Any suggestions?

  50. vikas gupta says:

    after completing above process when i reach this point i have following “error”
    Prepares Windows XP LocalSource for Copy to USB-Drive:

    0) Change Type of USB-Drive, currently [USB-stick]

    1) Change XP Setup Source Path, currently []

    2) Change Virtual TempDrive, currently [T:]

    3) Change Target USB-Drive Letter, currently []

    4) Make New Tempimage with XP LocalSource and Copy to USB-Drive

    5) Use Existing Tempimage with XP LocalSource and Copy to USB-Drive

    F) Change Log File – Simple OR Extended, currently [Simple]

    Q) Quit

    Enter your choice: 1

    Please give the location to your Windows XP Setup Source Files

    Error: The path Input Error: There is no script engine for file extension “.vbs
    “. does not contain Windows XP Source Files

    Press any key to continue . . .

    please give me solution ,i m in middle

  51. u disk, data processing speed is too slow, even if the installed operating system has no practical significance.

  52. i want to know that how to install xp through pen drive

  53. I used WinSetupFromUSB sofware to make pen drive install winXP, but when I boot from USB error given that hall.dll/ntoskrnl.exe file is missing. Iuse usb_prep8 also but same problem occur

  54. [...] burn it on a flash drive, but don’t now how to do that, then you can read the tutorial posted here by Satish bro. After burning insert the CD (or DVD or flash drive) into the computer of which you [...]

    • fathima saleem says:

      hi

      i tried the above steps. but when i enter “bootsect.exe /nt52 f:” it says – “could not map drive partitions to the associated volume device objects : access is denied

      how to resolve it
      os -windows 7

      • check if u r in admin mode….if not then go to all programs—->asessories—_ right click on command prompt and slesct run as administrator.

    • fathima saleem says:

      hi

      when i entered “bootsect.exe /nt52 f:” it says – “could not map drive partitions to the associated volume device objects : access is denied

      how to resolve it
      os -windows 7

  55. Hi, I have successfully completed all the above mentioned 15 steps for making the pen drive to boot to install the windows xp.

    I never faced any problems in the middle. When every thing is over I set my systems first boot in USB-ZIP in Bios & I saved & exited.

    I think the system will boot from my flash drive unfortunately it is booted in hard disk and went to previous windows.

    What will be the exact problem. Reply me please…..

  56. Worked perfectly
    for installing xp sp2 on a Dell mini with ubuntu via a fat16 stick.
    (Not a big fat32 stick).
    Thanks.

    I love ubuntu but have problems with pay as you go broadband and secure vpns :-(

  57. after the proceedure of bootsect completed as u said….

    Press 1 on your keyboard — this will bring up a window. Locate your XP folder and highlight it. Click OK

    so when i press 1 to locate xp folder and highlight it…… an error pops up…..

    error:the path cscript error: [can't find script engine "vbscript" for script "c:\usb_prep8\u_script\foldersel.vbs".]

    so what to do in this situation….help me guys…plzzz i m in middle of somthing……thanks and regards

  58. Manoj barange says:

    It is very good step
    I like it very much

  59. GAUTAM ROY, SILCHAR says:

    thanks for your solution , we have tested and is working fine , again thanks dude

    Do you have solution for windows 7 ? as well…..

  60. Is der any one who can help me out from dis……….?

  61. I did all the things and rebooted the sys and selected usb as first boot device. Got the BOOT ERROR msg..

    “wat’s next…………………………?”

  62. syberkeypower says:

    i have 32 gb kingstone pen drive when i copy data to pen drive and want to copy to another computer but all data was curreputed so plz help me

  63. ok
    got my problem
    but now its saying that no usb found

  64. hi

    i tried the above steps. but when i enter “bootsect.exe /nt52 j:” it says – “could not map drive partitions to the associated volume device objects : access is denied ”

    my laptop is running on vista premium , pendrive is 2gb . thanks in advance .

  65. thanks for given me a details for installation

  66. Mohd. Azeem Khan says:

    error 18 occured

  67. i’m not finding the file usb_prep8.cmd
    plz help
    if nay1 have mail me at patel.mahesh034@gmail.com
    urgent

  68. If I do this using an 8GB USB drive will I have any control over the size of the Ubuntu partition and will I have any trouble using the remaining space from XP?

  69. Here was a easier way to do same thing on youtube. This video http://www.youtube.com/watch?v=q9j4jnUbLd8&feature=fvw shows how to install ubuntu on usb pen drive easily

  70. danny & shaan says:

    tanks a lot sir…i made it sucess…its my achievement…i almost think tat its a concept…i nw it become true..rely tanks

  71. Hi there,
    I have already seen it somethere…

  72. I m using “Kingston DataTraveler 100″ pen drive for window installation but there is an error that “NTLDR not found”. Any solution ?
    Is there any this type of procedure for window vista ?

  73. Thanks for this, never heard of UNetbootin before… it almost literally saved my life :)

  74. hEY cOOL DUDE…BUT TE FILE CANNOT BE DOWNLOADED.
    pLZ HELP….

Leave a Reply

Your email address will not be published. Required fields are marked *