No announcement yet.

Win7 SysPrep CopyProfile Saga

  • Filter
  • Time
  • Show
Clear All
new posts

  • Win7 SysPrep CopyProfile Saga

    Im having issues syspreping a Virtual Win7 machine. I have an answer file saved to:


    I have the CopyProfile switch in there but when I run sysprep it isnt copying the profile over to the default profile.

    Here is my unattend.xml

    <?xml version="1.0" encoding="utf-8"?>
    <unattend xmlns="urn:schemas-microsoft-com:unattend">
    <settings pass="windowsPE">
    <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="" xmlnssi="">
    <Disk wcm:action="add">
    <CreatePartition wcm:action="add">
    <ModifyPartition wcm:action="add">
    <settings pass="specialize">
    <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="" xmlnssi="">
    <cpifflineImage cpi:source="catalog:e:/sysprep/win 7/sources/install_windows 7 professional.clg" xmlns:cpi="urn:schemas-microsoft-com:cpi" />

    Im using this command on the Win7 box to start sysprep running:

    sysprep /generalize /oobe /shutdown /unattend:unattend.xml

    Any suggestions to why this isnt working?? I used Windows System Image Manger to build the unattend.xml

    Alternately does anyone know of a tutorial online which will show me how to do this as the ones Ive been using aren’t working.

    All Im interested in at the moment is the copyprofile part



  • #2
    Re: Win7 SysPrep CopyProfile Saga

    I've had the exact same issue.

    Do not use the CopyProfile setting while doing the capture but use it when you deploy your image.


    • #3
      Re: Win7 SysPrep CopyProfile Saga

      Im not realkly sure what you mean.

      I've used a million tutorials online and am now so confused about the whole process.

      I ended up using this tutorial but its still not working.

      From what Ive read I may have made some mistakes. I already had an image which id customised prior to reading all about the Win 7 sysprep way of doing things. I thought this would be like Win XP where you can copy the profile in Windows before running sysprep.

      My image had the built in Admin account which I enabled & set a password on, it also had another x2 user accounts. One was to be used as an installer accout & the other was my template account which I made all the customisations on ready to copy this to the default profile.
      When i found out the copy profile was disabled I did the following:

      Deleted the install & template user accounts
      Customised the built in Admin account
      then followed the tutorial in the above link but missed out steps 9, 10, 11
      I just ran sysprep & chose Audit mode to restart in audit mode

      Have I messed things up by not doing ctrl+shift+F3 on the install?
      Last edited by Deland01; 25th April 2012, 08:55. Reason: typo


      • #4
        Re: Win7 SysPrep CopyProfile Saga

        When looking for a solution to the problem you described I stumbled upon this thread from the TechNet forums in which James from Microsoft proposes the task of checking the logs in the setupact.log file for the following: Search for lines that resemble the following (in the 'specialize' pass):

        [shell unattend] CopyProfileDirectory from C:\Users\Administrator succeeded.
        [shell unattend] CopyProfile succeeded.

        The setupact.log file can be found in %windir%\system32\sysprep\panther\

        As Wullieb1 one stated, you want to use your unattend.xml file with the CopyProfile setting while deploying your image. Depending on what you are using to deploy your image, this process may differ. I personally recommend using Windows Deployment Services and the Microsoft Deployment Toolkit (MDT). MDT combines all of the official tools above into a single workbench interface that can help automate the entirety of the process. Additionally, it is compatible with Windows XP, Windows Vista, Windows 7, and Windows Server 2003, 2008, and 2008 R2, which means learning one utility to do all of your deployments. Furthermore, it is exceptionally useful in creating “universal” images as it can easily add or remove drivers or applications from the deployment images.

        For example, if you use WDS for your deployments you would include the answer file in the deployment by opening the properties of the image in the WDS console. From there, you should see an option to include an answer file. You will want to use the same one you used to sysprep and create you image.

        Also, you might want to consider following the deployment steps in TechNet’s Step-by-Step: Basic Windows Deployment for IT Professionals in addition to reading the Microsoft Knowledge Base article How to customize the default local profile when you prepare an image of Windows Vista, Windows Server 2008, Windows 7, and Windows Server 2008 R2.

        A final recommendation to read and learn from is the following TechNet blog posts Configuring Default User Settings – Full Update for Windows 7 and Windows Server 2008 R2 and Customizing Default users profile using CopyProfile.

        Windows Outreach Team – IT Pro


        • #5
          Re: Win7 SysPrep CopyProfile Saga

          Finally got it working!!!

          Thanks for the help, I had read these articles previously but I must have only skimmed through whilst trying to find another way of copying the default profile without using sysprep. The few tutorials I went through online took me through MDT & WIM but I still couldn’t get it working. I think I was trying to over complicate things with a stupidly complex answer file.

          For anyone in the same boat as me here's what I found out / did.

          All the articles online tell you to do a fresh install of Windows, hit Crtl+Shift+F3 when it asks you to create your fist user account to reboot in audit mode.

          I found it doesn’t matter if you have a previous install of windows which you had user accounts on. As long as you delete them before running sysprep the copyProfile switch works fine.

          You also don’t need to be in audit mode to run the sysprep command which is what other people were saying.

          You don’t need Windows enterprise, I used Win 7 Pro and it worked fine.

          After sysprep completed I tried to copy the install.wim file from the hard disk to USB and for some reason it said the USB was full. The install.wim file was only 8GB and I had 20GB spare. I used a second 1TB USB hard disk and I was able to copy the file off. Here was the command to copy the file:

          imagex /compress fast /check /flags "Professional" /capture D: L:\install.wim "Windows 7 Professional" "Windows 7 Professional Custom"

          To get the above command to work you need to cd on dos to the drive where imagex is located.

          “/capture D:” – D:\ is the drive letter where your sysprep’d windows install is, this may be different on your system
          “L:\install.wim” – L:\install.wim where you are going to copy the file to, in my case L:\ was my 1TB USB hard drive

          Here's what I did which I managed to get working
          Installed windows & configured the built in admin account
          Deleted all other user accounts
          Copied the following "unattend.xml" file to C:\

          <?xml version="1.0" encoding="utf-8"?>
          <unattend xmlns="urn:schemas-microsoft-com:unattend">
          <settings pass="specialize">
          <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="
" xmlnssi="">
          <cpifflineImage cpi:source="catalog:e:/sysprep/brianleejackson/sources/install_windows 7 professional.clg" xmlns:cpi="urn:schemas-microsoft-com:cpi" />

          The above is for a Windoows 7 x64 machine
          Ran DOS as an administrator
          ran the following command:

          %systemroot%\system32\sysprep\sysprep.exe /oobe /shutdown /generalize /unattend:c:\unattend.xml

          The PC will shutdown
          Either image the PC with something like Norton Ghost or Acronis, or use Windows PE on a USB to copy the "install.wim" file off the hard disk. You can then replace the install.wim on the Windows CD with your install.wim and make a custom Windows CD.

          Apologies if this isnt 100% the correct way of doing it but it worked for me so I hope it helps someone else out


          • #6
            Re: Win7 SysPrep CopyProfile Saga

            Now if you've read all that then you disserve to know about DefProf which gives you back the functionality to copy the user profile in Windows

            Had I fond this a month ago I would have saved about 2 weeks development work!!

            I’ve tried it on Win 7 & Server 2008 & have had no issues.



            • #7
              Re: Win7 SysPrep CopyProfile Saga

              Great find.

              I might even try it on a fresh build at some point.