How-To: Image Windows XP with Ghost and Sysprep

I tend to install and reinstall operating systems quite frequently on my home system. With my hectic schedule, I don’t have time to sit down to reinstall and configure every last program. Although it is arguably easier to use a backup of my system for day-to-day mishaps, I tend to change out peripherals a lot and restoring a system that does not have certain drivers “cleaned out” tends to wreak havoc on a new configuration. To make this process go a bit faster, two years ago I created a “Ghost Image” of my hard drive after doing a basic install. Now, instead of it taking a few hours of toiling away to reinstall a system, I can do this all in about 15 minutes with only half a dozen quick mouse clicks. The trick is to use Norton Ghost or any other imaging software and Microsoft Sysprep.

Part 1: Install XP and Sysprep

  1. Install Windows XP on a clean hard drive.
  2. Do not install any drivers or other utilities that are hardware specific beyond what Windows itself installs.
    • This is necessary to make sure the image is as portable as possible across different types of systems. However, different storage controllers and different HALs (Hardware Abstraction Layers) make this harder to predict.
    • Most modern computers these days work fine with a standard ACPI HAL, but if this image is to be truly portable across multiple machines then it must be determined which specific HAL will be needed. Refer to Microsoft KB309283 if you are completely lost.
    • It is also important to determine if the target system uses a storage controller that normally requires a driver disc during a regular XP install. If this is the case, then the necessary paths to the drivers must be included in the Sysprep.inf file. These must be added to the [SysprepMassStorage] section in the form PCI\VEN_###&DEV_#### = PATH_TO_DRIVER_ON_IMAGED_DRIVE where VEN_#### should be replaced by the Vendor ID number (i.e. VEN_1234) and the DEV_#### should be replaced by the Device ID number (DEV_1234). This information can usually be found in the specifc driver INF files. Here is an example for adding the VMWare SCSI controller driver to sysprep.inf

      ….snipped out windows mass storage driver list….


  3. Create a testuser account with administrative privileges. Use this account to install and configure all the software and policies on the system.
  4. Remember to run Windows Update, Office Update and make sure all the rest of the software is up to date. You’ll probably end up rebooting a few times in between but keep going until everything is updated.
  5. Copy all the start menu items from the testuser account to the Administrator start menu. (Note: This is necessary as some installers do not create start menu items in All Users but within the testuser profile only. This leaves some items missing on the Administrator start menu.)
  6. Log out and log back in as the computer Administrator and then copy the testuser profile folder to the default user profile folder. This is done via Control Panel -> System -> Advanced -> User Profile “Settings” then select testuser and click Copy to. Copy all of this to c:\Documents and Settings\Default User. If you don’t understand then refer to Microsoft KB291586.
  7. Delete the testuser account. Make sure that c:\Documents and Settings\testuser has been deleted too.
  8. Download Sysprep for XP SP2.
  9. Extract the files to c:\sysprep.
  10. Create the basic sysprep.inf file by running setupmgr.exe. This a tool Microsoft provides for creating an answer file so the restore doesn’t involving asking the normal setup questions. The basic steps are below:
    • Run setupmgr.exe
    • Click Create New
    • Click Sysprep Setup
    • Then choose whichever product you are using. In our example it would be XP Professional.
    • The next question asks: Do you want to fully automate the install? All this question determines is who is going to accept the EULA, you or the person restoring the image. Also, picking yes means that you must enter your Product Key. I pick no because this is for my own use and I don’t want someone to swipe my Product Key accidentally, but a large company or OEM may choose differently.
    • The next few sets of options are for you to enter in any information like your Name, Organization, Time Zone, Product Key (I leave this blank), Network Settings, etc.
    • I leave the Computer Name option set to Automatically generate computer name.
    • Once completed, a dialog box will ask where you want to save the file. c:\sysprep\sysprep.inf is the path we’re using in this example.
    • On the completion screen, click Cancel to close setupmgr.exe.

    The process of creating a basic sysprep.inf file is now completed.

  11. Before proceeding to the next step, create a custom hardware drivers directory for any drivers needed for the target system. Usually I use c:\drivers.
  12. Open c:\sysprep\sysprep.inf in Notepad and add the following lines to the relavent sections (if the heading doesn’t exist, create it):




  13. Do not close the sysprep.inf yet! OemPNPDriversPath points to the c:\drivers directory created earlier. For organizational purposes, I split up my custom driver files based on category (i.e. hardware_cat in the example above). For example, all video drivers go under c:\drivers\video and network drivers under c:\drivers\network. In each of those directories, the specific driver bundles are placed with their driver inf files (i.e. driver_dir). For example, the latest nVidia drivers would go into c:\drivers\video\nVidia\. The last part is refering to driver_inf is just that, the name of the inf file. For example, for the latest nVidia driver, the path would be c:\drivers\video\nVidia\nv4_disp.inf. In sysprep.inf, the path would be written as OemPNPDriversPath=drivers\video\nVidia\nv4_disp.inf;. Do not forget the semi-colon as a separator. For the next driver, repeat the procedure by placing the path after the semi-colon without leaving a space. Once all the drivers are added, save the file.
  14. Run c:\sysprep\sysprep -bmsd. This will build the Windows XP standard mass storage drivers section.
  15. While editing sysprep.inf there is an option labeled InstallFilesPath which usually points to c:\sysprep\i386. I usually copy the contents of my XP CD’s i386 directory into c:\sysprep\i386. This isn’t necessary.
  16. Add any custom Storage dirvers to the [SysprepMassStorage] section as detailed above.
  17. Now run C:\sysprep\sysprep.exe.
  18. Pick options Mini Setup and Detect non-plug and play hardware. If you don’t have a volume license and plan on just using this image for restoring the computer the image was made on, then pick the option Don’t regenerate security identifiers. If you have a volume license key and will be using this image for multiple machines then leave that option unchecked. Ensure that Shutdown is selected from the Shutdown mode drop-down menu and click Reseal.
  19. If you left the SID option to regenerate, then a pop-up will ask you to confirm. hit OK to continue.
  20. This will take a while and your system will shut down once the process is complete.

Sysprep is now complete. Part 2 discusses imaging.

Pages: 1 2 3


144 Responses to “How-To: Image Windows XP with Ghost and Sysprep”

  1. Luc on April 4th, 2007 4:21 am


    I work for a company that makes many pc’s from images for different types of models.
    My problem is when i create a unattended windows install cd with a installation-product key that is provided with the xp. I want now to use sysprep to make the pc’s ask the user for there licence key.
    I made a ghostimage to put on every pc that we have to make but when i do not use the image in 30 day’s we get the message to activate the pc. It’s the idee to let the final users activate and register those xp themselfs but when we put the image back on the computer we can not do the last step : activate syspreps reseal option because we are obligated by the xp to activate first. Does anyone have a sollution for this?


  2. jimmy on April 11th, 2007 8:33 pm

    hey does any 1 know any solfware that i can remove all the window driver? cuz im scare storage driver and other driver taht installed on the system will afffect the other system that i gonna install my ghost in

  3. Slider on April 16th, 2007 6:02 pm

    In my company, we use Dell desktops and laptops. I have been using sysprep image for few years and have been able to resolve most of the issues.

    Now I created a multiprocessor image that works on all desktops and newer laptops. The problem is with the machines using ATI graphics cards (X300, X600, X1300). Image loads fine and everything is functional. After about a day, I reboot the computer and the resolution changes to VGA and the colors change to 4-bit. This only happens to the computers with ATI cards and this did not happen with the uniprocessor image. Some computers have been upgraded with nVidia cards and the laptop D820 came with nVidia card, so these computers don’t have this problem. Also, if I remove the ATI card and run on the onboard Intel graphics adaptor, problem disappears.

    I have the latest drivers and BIOS. I am desparate for a solution.

  4. KP on April 18th, 2007 6:36 am


    For some reason when I copy over the testuser profile to the default user profile … run sysprep … the settings in the start menu and desktop don’t seem to stay … anyone have any ideas what I’m doing wrong ? … appreciate the help.


  5. Titch on June 14th, 2007 4:31 pm

    I am having trouble with this when doing it with Windows Home. My problem is that one cannot log into the Admin account to delete the account you create on first boot. Unlike XP Proyou have to have atleat one other account it seems. When my cust boots up for the first time everything will be fine except for the fact that there is an extra user account.

    How does one remove this account prior to or during customer first boot?

  6. Dane on June 15th, 2007 4:47 pm

    I image systems at my company pretty much exactly as described in the article. I make specific images for each brand/model and they are stored on our SAN. I have a boot disk I made that logs the machine onto the network, then goes out, searches for all the ghost images on the SAN then generates a menu on-the-fly and displays them based on manufacturer and model. Just highlight the one you want, hit enter and it starts up ghost and pulls the image.

    I’m having a problem with the images though. Every time I pull an image down, many of the settings are no longer there. For example: part of the settings I make when I build a load from scratch on a system is to add some DNS suffixes for our network. On our laptops, we also set up some dialups (in case a user is somewhere that doesn’t have highspeed) and they run through a proxy. Well, when I pull the image back down, all the DNS suffixes are missing and the proxy settings for the dialups are gone as well. There are a few other settings that don’t seem to transfer over either. It seems sysprep is blowing them away.

    What can I do to get an EXACT image of my drive? It’s very time consuming to have to image a new system, then go through all the settings and reset them. I would like to just pull the image and be done.

  7. roy on July 11th, 2007 1:21 am

    Steletje maffe hoeren,

    stelletje geeks, jullie zijn egt dom!!!:|:|:| cker allemaal voor ajax(N)


  8. IT Intern on July 17th, 2007 5:41 am

    dose any one know how to use this with Microsoft’s Automatic Deployment Service (ADS)????

  9. Sunyata on July 22nd, 2007 11:50 am

    Thanks a lot for the article! Have an old laptop with a broken CDROM drive. The HD died as well, so I bought a new one and tried installing Windows onto it first through USB and then by sticking it into another laptop. Putting it back into my old laptop, XP wouldn’t boot, freezing after mup.sys. You and saved my day

    Peace and best regards,


  10. Olli Janatuinen on July 24th, 2007 9:26 am

    Now it is really possible. You can make generic WDS image from XP. Please check my guide:

  11. juegos on August 1st, 2007 12:54 pm

    Very good blog, and nice the content, thanks for the information..

  12. Sohaib Hassan on August 6th, 2007 11:06 pm

    Asslam o Allikum
    Sir I want to make a windows ghost but I don’t know to make it.
    please help me.

    thanks a lot.

  13. Sexo on August 14th, 2007 9:19 am

    yet another trick to try………

    Creating an image on an IBM 6792 targeting use on 6792 and 6794 machines.

  14. Dengo on August 31st, 2007 8:44 am

    Hi! I’ve created a bootable floppy and tried to boot the PC. OS is loaded into memory, and then the Ghost program started and hung. Nothing happened after that. HDD is formatted as NTFS (but there shouldn’t be a problem, since you did the same). The external HDD is also SATA, formatted into NTFS and connected via USB2. What do you think can be done? Thank you!

  15. Polssak on September 5th, 2007 3:39 am


    If are using IE7 and then run sysprep, OS not run propertly(error msoobe.exe).


  16. Clif on October 3rd, 2007 6:57 pm

    I found that duplicating a WinXP SP2 partitiion with the source ( primary master ) as the boot and the target as a secondary master produced a duplicate that would go directly to shutdown moments after the login procedure begins .

    I put the drive into another system as a non bootable drive .
    I created a partitiion and used Ghost 12 to duplicate the source into the newly created partition without MBR or bootable options.

    Being limited on component expansion in this bench system , I swapped the source drive for target drive .

    I created an unformatted partition on the target drive and used Ghost 12 to duplicate the the stored partition created from the source . I used the MBR bootable options .

    didn’t have to do enough trial and error to run upon too many issues . As for a login going direct to shutdown issue when booting a Ghosted drive clone , maybe this will help others .

    The target boots and WinXp works fine .

    — Clif
    Kansas City, Missouri

  17. Dtown on October 29th, 2007 1:00 pm

    Is the following step #11 required?
    Before proceeding to the next step, create a custom hardware drivers directory for any drivers needed for the target system. Usually I use c:\drivers.

    If the source computer and the destination computer are exactly the same, do I really needs to do this? Wont the drivers from the Source computer copy to the destination computer without having to do step 11?


  18. Eddie on November 19th, 2007 4:44 pm


    I am trying to create an image of one computer to use on other computers, I dont want to reinstall XP, i just want this image to automatically log computers onto the domain and install various sw, any ideas on how i can do that??

  19. William on November 30th, 2007 7:38 am

    I am using the sysprep utility and the mini-dump is not working the way I need it to. After I run sysprep.exe I choose to quit rather that restart or shutdown. I then delete the sysprep folder and then shutdown the computer. I then use a BartPE CD to boot up the computer and image it to an image server. After I creat the image I shutdown the computer and then when I turn in back on it seems like it starts correctly but I want it to only ask me for my computer name but it requires me to enter company name, XP key, etc. I’m not sure what I am doing wrong. Any help would be appreciated.

  20. on November 30th, 2007 8:57 am

    i cant uninstall yahoo internet installer its wrong or uninstall yahoo mail i have yahoo 7 and have searched many sites until i am now completed frustrated. i know there is a link called auto complete but cannot find it again. PLZ help this lost little soul i dont know if i can reinstall messenger 7 over these in the add remove programs and that will be ok. please advise

    thank you in advance

  21. Sigin on December 13th, 2007 3:14 am

    How to Run c:\sysprep\sysprep -bmsd.???????
    i tried but i dont know how……………………………
    please tell me step by step………………

  22. MattPSU on January 10th, 2008 12:56 pm

    I am getting the following error message while trying to run sysprep 2.0:
    “An error occurred while trying to update your registry.
    Unable to continue.”
    I think it has something to do with certain updates for software that I am installing.
    Anyone have any ideas????
    Thanks in advance!

  23. Robert_RaleighNC on January 10th, 2008 2:47 pm

    Jan 10th, 2008 at 12:56 pm

    I am getting the following error message while trying to run sysprep 2.0:
    “An error occurred while trying to update your registry.
    Unable to continue.”
    I think it has something to do with certain updates for software that I am installing.
    Anyone have any ideas????
    Thanks in advance!


    I had the exact same problem today after carefully crafting an image that supports 9 different pieces of IBM h/w. I found a MS article for Sysprep 1.1 that may hold the clue even tho it is for the previous version of Sysprep:

    It says to look carefully at the mass storage drivers section of your sysprep.inf for mis-entered components. I used the sysprep -bmsd command to build my list for the default MS components that are natively supported, and then added about 6 lines of my own MANUALLY for AHCI controllers on the IBM T60, 61.

    You can, of course comment out any line in the sysprep.inf file by putting a ; at the beginning of the line. I am going to go back through my manually entered lines to make sure the h/w ID is correct, etc. for the ones I did by hand.

    This exact Sysprep.inf worked fine for me last March when I did this the first time (and it worked beautifully). The only thing that changed was some updated programs, Windows updates, etc. and THE LINES I ENTERED MANUALLY. I had entered 2 lines of mass storage driver info before for a 6218 Intellistation desktop’s SATA RAID controller with no problem. It’s got to be (according to MS kb249690) in those last 4 lines I did by hand.

    I’ll let you know how it turns out. Post back if this helps out…

    Robert B
    Raleigh, NC
    Private CRO Co.

  24. Rob_RaleighNC on January 11th, 2008 6:25 am


    I am getting the following error message while trying to run sysprep 2.0:
    “An error occurred while trying to update your registry.
    Unable to continue.”


    I got the same error today. I think i fat-fingered one of my manual entries for a mass storage driver in that section at the bottom. I have the natively supported stuff that sysprep -bmsd command puts at the bottom and a few entries of my own. I recently added 2 more and may have duplicated a device as 2 different descriptions. See the MS article (applies to sysprep 1.1, but may be the answer in 2.0):

    I’ll let you know what happens with my sysprep.inf file as soon as I look at it for errors at the bottom…

    Rob B. Raleigh, NC

  25. Odie Pastunik on January 19th, 2008 2:25 am

    Overwritten default user profile

    If another user profile has been copied over the default user profile, Microsoft does not support the use of Sysprep to create a new image of the installation.

  26. rafeeque on March 5th, 2008 12:36 am

    plz send image also

  27. right.. on March 6th, 2008 1:45 am

    found this site through google while installing a clean machine (no FF alas)

    but WHY THE HELL do you need that F*CKING annoying yellow bar all the bloody time?
    i KNOW i should use FF – now GET RID OF THAT CRAPPY THING

  28. Nick on March 18th, 2008 9:44 pm


    Great, great guide. Ghost Solutions Suite documentation does not cover sysprep in detail, so your guide has been a tremendous aid.

    Good one!


  29. ctitimothy on March 26th, 2008 12:47 pm

    I have to create an image file to deploy XP on multiple DELL laptops configured with the same settings and applications. My boss also wants me to make a step by step instructional for installing job specific applications into the active directory to prompt. So, my question is: Will Ghost be able to do this or should I try Acronis?

    Also, any tips you can give me because he is adament that I will only need one iso file (add all necessary drivers for each model laptop of course) to be able to deploy to any of these laptops at a given time.

    Thanks in advance.

  30. Gord on April 7th, 2008 4:00 pm

    I thought this had been covered before but i can’t find it at the moment so i’ll post this.

    We have Acer machines with an OE factory XP Pro image, but when we sysprep with minisetup, and using our corp vol license key, we get an error stating that the product key is not valid, which is somewhat expected but is there a setting to use to get sysprep to wipe whatever setting is in the factory image so our vol key doesn’t conflict?

  31. Hisham on April 9th, 2008 10:32 pm

    @Gord: I’m assuming that you’re trying to repackage the Acer machine’s OEM XP install without installing your own corporate XP install cd? If that is the case, then that is your problem. You need to run a “key finding” utility and find what key Acer has installed. The chances are that it is the same OEM key on every machine. You may just need to enter that instead of your corporate key. However, I’m not sure of the legality of this method so please call Microsoft to confirm it–I can’t take responsibility if you get in trouble.

    To use the corporate key in your possession you’ll have to do a fresh install with the corp version of XP.

  32. dave on April 28th, 2008 8:48 am

    You mention that the base OS shouldn’t have have any other drivers installed other then the ones the OS found.
    In my case the NIC card wasn’t found. Therefore, I won’t be able to install all the Window updates and security patches without the card. So if I install the driver, will this have an affect on other machines that don’t have the same card?


  33. Hisham on April 28th, 2008 8:18 pm

    @dave: the problem isn’t the driver itself. The problem is the helper applications the driver can install that go haywire when they don’t detect the card they were installed for. If your card allows just the driver to be installed then you should be okay.

  34. Khaled on May 29th, 2008 8:14 am

    Do you know how to image the XP to a network location?

    Thanks a lot, I really appreciate your help !

  35. Linda on June 16th, 2008 7:51 am


    Very good site. We are having a problem using UIU and Sysprep. The computer hangs while doing the mini-setup looking for a driver. The mouse and keyboard stop functioning so we are stuck. Any advise. Thanks in advance for your support.


  36. Hisham on June 16th, 2008 11:47 am


    You should probably call UIU’s support facility because I don’t have any experience with that particular piece of software. Good luck.

  37. Dick Treen on July 12th, 2008 7:30 am

    Thank you for this excellent tutorial Hisham. I have a small, 4 station network and have used sysprep to transfer XP with updated software from 1 machine to the other 3. My problem is that I find the nodes in the workgroup under “Microsoft Windows Network” although having the correct individual names, are duplicated in their sub-structure. This means the have the same shared drives and folders etc. as the source machine instead of their own. Please can you tell me if this is fixable?

  38. Johan Michel Struijk on February 23rd, 2009 7:06 am

    I do this quite a bit also but I only run into trouble when a system has a different motherboard… is there any way to make it totally hardware independent (while still keeping all the applications and settings I have set up)..?

  39. Hisham on February 23rd, 2009 7:19 am

    @Johan: I’m sure people have found ways to do this without additional software but I know of two programs that can help achieve this feat. One is Acronis Trueimage with Universal Restore. The other is Ghost Solution Suite. Once you build a base image, you can restore onto any machine using either software.

  40. Chaos on March 29th, 2009 4:55 pm

    Is it possible to modify the sysprep file to look for additional drivers AFTER the sysprep image has been made? I have an image that is already made, and I need to add support for a different model. In the past I have added support for new models by ghosting my image to the new model, renaming the C:\drivers folder, letting the machine setup, and adding the drivers to my c:\drivers folder and re-sysprepping. I have been wondering if it is possible just to modify the sysprep.inf OemPNPDriversPath to add the new path and just put the drivers into the image and be done with it.

  41. Mikael Sundlin on April 16th, 2009 1:01 am

    If your mouse get stuck in the mini installation take a look at this =)


  42. Don Seibert on August 24th, 2010 6:25 am

    Is there a way to update the image once it is sysprepped? I am going to be managing a number of images but don’t have all the hardware to update with.

    Thank you.

  43. Don Seibert on August 24th, 2010 6:31 am

    Also, what files are neccesary to go into the drivers directory. Do you need all the install files and support files or will only the .inf files do.

    Thank you.

  44. Hisham on August 24th, 2010 9:16 am

    @Don Seibert: If you’re managing a number of images then it behooves you to check out Microsoft Deployment Toolkit which is designed to make your life easier.

    This is one of those times that having a “master” computer for each hardware type is useful. However, you may be able to do the same thing with a strategy involving VMware or VirtualBox. I’m not sure if the Windows XP HAL issue will cause problems with this strategy but it’s worth exploring.

    As far as drivers, I usually dump the entire contents of a driver into its directory because it’s far too time consuming to figure out which files are needed without digging through INF files and/or tracking a driver installer’s behavior. These days, a few extra megabytes just isn’t worth the time.

    You should also take a look at this thread on a possible strategy:

    I’m only a hobbyist so take my advice with a grain of salt.

Leave a Reply

To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Anti-spam image