Go to ...
RSS Feed

Windows 10 Unattended install media – Part 5: Sysprep & Capture Image

Final phase of this project is to sysprep customized Windows image, capture it to a WIM file, and create an ISO for completely automated installation.

Create a Checkpoint

On your reference Hyper-V VM, create a checkpoint before proceeding. Select Action > Checkpoint in Virtual Machine Connection window, name the checkpoint as you wish, click YES to save it:

Later when you Sysprep or capture the image, if something goes wrong, it simply does not work, or if the system presents an error message, you can restore the state of reference VM as it was when checkpointed. This process takes less than a minute, after which you can troubleshoot / fix the errors, and try again. Consider it a form of cheap and fast insurance, because that’s exactly how it works.


On the reference VM, browse to the C:\Windows\System32\Sysprep folder, run Sysprep.exe. Select System Cleanup Action > Enter System Out-of-Box Experience (OOBE), select Generalize, select Shutdown Options > Shutdown, then click OK to start Sysprep:

Sysprep will run and generalize the Windows image (make it hardware independent). Windows on the reference VM will be shut down when Sysprep is complete:

Depending on the size of the Windows image (installed software, customizations etc.), this can take anywhere from a very few minutes to as long as 10-15 minutes (seldom longer, but for a huge complex Windows installation that’s at least possible).

Capture the custom Windows image

Open Disk Management on your host machine. Attach the reference VM’s VHDX file (virtual hard disk):

Attach the VHDX (virtual hard disk file) from your reference VM to the host. In case you have made one or more checkpoints, when deciding which VHDX to attach, select All files and attach the last checkpoint file (checkpoint file extension is .avhdx). Check the file’s Date Modified timestamp to be sure you attach the most recent checkpoint created:

Set the VHDX or AVHDX file as read only:

File Explorer will automatically open the attached VHDX or AVHDX (checkpoint). Note the drive letter it gets. In my case, it got drive letter I:

On the host machine, open an elevated (Run as administrator) Command Prompt. Enter the following command, changing the path in /ImageFile: to wherever you’d like to save the captured install.wim file, and set /CaptureDir to the drive letter for your attached (mounted) VHDX or AVHDX file. Name it as you like (/Name:”AnyName”):

dism /Capture-Image /ImageFile:H:\Capture\install.wim /CaptureDir:I:\ /name:"W10PRO" /compress:maximum /checkintegrity /verify

In case you used a physical PC as your reference machine instead of a Hyper-V VM, see this support article on Microsoft Docs about how to capture a Windows image from such a machine: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/capture-images-of-hard-disk-partitions-using-dism

Be patient. Capturing an image is a resource eating process, on slower hardware it can take several minutes even for the progress bar to appear and start from 0%. On this laptop of mine, the whole capturing process takes about half an hour, progress bar appears first in about 10 minutes. On the other hand, on a fast i7 machine with an SSD, the whole process is done in couple of minutes.

Make ISO

Create a folder anywhere on your host, and name it ISO_Files (that’s the name I use, you can of course name the folder as you wish). Mount the Windows 10 ISO image you used to install Windows onto the reference machine as a virtual DVD drive (right click ISO > select Mount). In File Explorer, select the mounted ISO, copy its entire contents to the ISO_files folder.

Now, copy the autounattend.xml answer file you created in Part 2 to the root of the ISO_Files folder. Open the ISO_Files\Sources folder, and delete the  install.wim file. Copy your custom install.wim file captured above into the same folder, thereby replacing the original. That’s the new customized image you’ll be installing!

In Part 2, when creating the answer file named autounattend.xml for Windows Setup, we installed the Windows ADK Deployment Tools. Part of those tools is the Windows Deployment and Imaging Tools Environment. Right click it in Start > W > Windows Kits, then select More > Run as administrator:

By default, it has a disturbingly long prompt. Run the command cd \ to jump to the root of C: drive, then enter following command to create your custom ISO:

oscdimg.exe -m -o -u2 -udfver102 -bootdata:2#p0,e,bH:\Iso_Files\boot\etfsboot.com#pEF,e,bH:\Iso_Files\efi\microsoft\boot\efisys.bin H:\ISO_Files D:\AnyName.iso

This line may break across multiple lines in your Web browser. It’s a single command, and a single line of code. Simply triple-click (like double click but click mouse left button rapidly three times in the code box) the command, right click it and select “Copy” to copy the whole thing into your paste buffer so you can paste it into Deployment and Imaging Tools Environment.

Here’s a screenshot of what this looks like when run in Deployment and Imaging Tools Environment window:

Click to view enlarged in a new tab.

Notice that the OSCDIMG command switches have no spaces or other characters between a switch and its properties.For instance, the path to the boot files appears as bH:\Iso_Files\, where b is the switch and H:\ISO_Files\ is its target folder. Name the ISO as you wish with the extension .iso and select where to create and store it (that’s the red highlight in the preceding command sample).

That’s it folks! You have now created Windows install media for a totally automated, hands-free Boot & Forget installation of Windows 10. You can use this ISO as-is to install Windows from a network share, or copy it to a USB flash drive and boot a PC from it to install Windows 10 without any user interaction.

Please do not hesitate to ask any questions about anything covered in this series of stories. Simply post a comment with your questions here, or in any of its other parts (1-4).

Links to all five parts:



Author: Kari Finn

A former Windows Insider MVP, Kari started in computing in the mid 80’s writing code for VAX / VMS systems. Since then, he’s worked in a variety of IT positions. He specializes in Windows image capture, customization, repair and deployment as well as Hyper-V virtualization. Kari is a proud Team Member at number #1 Windows site TenForums.com.

26 Responses “Windows 10 Unattended install media – Part 5: Sysprep & Capture Image”

  1. May 31, 2018 at 05:36

    naturally like your website but you have to check the spelling on several of your posts. Many of them are rife with spelling problems and I find it very bothersome to tell the truth nevertheless I’ll definitely come back again.

  2. Daniel
    June 25, 2018 at 15:13

    I dont really know what you are using the Asset Share for with the setup files or maybe I missed something?
    Where do you say the Process to install these files?

    Thank you very much for the Tutorial!

  3. June 25, 2018 at 16:06

    I am using the Assets share to transfer installers and other files to reference machine.

    While Windows installs on reference machine, I’ll prepare the Assets folder on technician machine sharing it. When reference machine is booted to Audit Mode, I have fast and easy access to various installers, themes and other files on the shared Assets folder.

    It’s much faster and simpler than to download everything needed on reference machine.

  4. dayang333
    June 28, 2018 at 13:11

    Hi, as my understanding,this is the process to create the USB installation media.How about the boot image if we use WDS?

  5. June 28, 2018 at 13:17

    This series of posts does not show how to create a USB install media for unattended install, it shows how to create an ISO image.

    At the end of this Part 5, you will be told how to create a custom ISO image. You can use that for any available deployment method. To create a USB is one option, to use ISO in other deployment scenarios as such is another option.

  6. James
    July 22, 2018 at 20:31

    Kari, Great write-up. I have managed to use this completed custom ISO image to deploy another VM to prove it worked. The only interaction i had before Windows loaded was at the language screen settings where there was no option to change from the default Language to install ;English (United States).

    The ‘time and currency format’ and also ‘keyboard or input method’ settings were displayed as expected as EN-GB which is what i set them to in my answer file. Not sure why the language to install was not this as well though, is that due to the ISO i used? Should i have set the fallback language to EN-US in my answer file so this screen would not be displayed?

    Secondly. It would be great if you did a follow up video on how to deploy this custom image we have created out using WDS (if that is the preferred method these days). When testing, I try to add my custom .WIM file in WDS it says ‘the file does not contain a valid install image’.

    Keen to understand next steps on how we deploy this out to multiple machines via pxe at once to complete this series.

  7. Krzystoff
    October 9, 2018 at 14:54

    @Emilie Dunomes — Why do you bothersome to tell the truth ?
    Also, I wonder why is it that misspelling irks you, but mispunctuation doesn’t phase you ?

  8. Krzystoff
    October 9, 2018 at 15:02

    Kari, great article — though at my level it looks quite overwhelming, TBH. Once upon a time you’d just setup a workstation and run NortonGhost… done, (if only that still worked)!
    I would like to try this out, but I have some concerns about when/how to activate applications and licensing (can that be done before the ISO creation?); Could you go into more detail about the best practice for networking/IP setup (eg. my network has no domain at present, just a NAS and a dozen or so workstations)?

  9. Lee
    October 17, 2018 at 15:57

    Thank you for this guide. Has been a great help but am having a problem when trying to import the WIM into WDS. I’m receiving a message stating that the WIM is not valid.

  10. October 17, 2018 at 21:37

    Lee, it might be and most probably is my fault. Checking this post now, I noticed that I have for some reason added a totally unnecessary switch to the DISM command to capture the image. The command as it was in this post of mine is as follows:

    dism /Capture-Image /ImageFile:H:\Capture\install.wim /CaptureDir:I:\ /name:"W10PRO" /compress:maximum /checkintegrity /verify /bootable

    That very last switch /bootable is totally unnecessary. It does not cause any harm when image is used in traditional deployment, but from my own experience I know it can cause issues with WDS.

    I will edit the post immediately after posting this reply and remove that /bootable switch from command sample. Please try to capture the image again, this time with this command:

    dism /Capture-Image /ImageFile:H:\Capture\install.wim /CaptureDir:I:\ /name:"W10PRO" /compress:maximum /checkintegrity /verify

    You should now be able to import WIM file to WDS.

    My apologies.


  11. November 29, 2018 at 21:28

    Glorious! Thank you Kari! There is so much misinformation or outdated information or incomplete information about syspreping a Windows OS. Your 5 articles bring it all together and explain exactly how to do what we wanted to do.

    Works perfect! The Online support link in the OEM information doesn’t do anything but I’m guessing it’s a Windows 10 bug.

    Thanks again!

  12. Paul
    January 9, 2019 at 00:18

    Hi Kari, great article, thanks. However, when booting from the ISO (via USB), setup starts and then says: “Select the operating system you want to install. No images are available”.

    Any ideas?



    • January 9, 2019 at 00:36

      Hi Paul.

      There can be two reasons:
      1.) because the autounattended.xml file on root of the install media, in your case USB drive, is either wrong or missing information.
      2.) The captured custom install.wim is damaged, not valid.

      As uploading files and screenshots here in comments is not possible, and because I would need some of those from you, I would like to ask you to register on TenForums.com. I have published this series as a tutorial there, it would be much easier to try to assist you if you posted about your issue in the tutorial thread: https://www.tenforums.com/tutorials/96683-create-media-automated-unattended-install-windows-10-a.html


  13. Fanie
    January 13, 2019 at 11:41

    Hey Kari

    Thanks for an excellent tutorial,

    I’m am however stuck on dism /Capture-Image /ImageFile:H:\Capture\install.wim /CaptureDir:I:\ /name:”W10PRO” /compress:maximum /checkintegrity /verify

    obviously I changed the drive letter etc.

    I get error: 5
    access is denied

    please help

  14. Fanie
    January 13, 2019 at 13:50

    Hey, never mind, I figured it out.
    Locations got scrambled, all good now.

    Thanks for the awesomeness!

    • January 15, 2019 at 01:21

      Good to know you got it to work!

  15. Bryan
    January 14, 2019 at 20:02

    I was able to create a working Answer file from this step by step guide. Thank you!

    One follow up question regarding the 3 security questions (1803,1809) during oobe. Would this answer file skip those questions? Usually would you use skipmachineOOBE = true to by pass this?
    These settings are depreciated. Would those settings still work?
    I am are trying to skip the entire Cortana oobe setup.

    Thank you

  16. Jacob
    February 7, 2019 at 23:07

    Hello Kari, thanks for the write up. It worked perfectly for me in 1709 OS builds. However, I’m trying to do the same in 1803 currently and I’m having a problem. When I sysprep using the unattend.xml file that is created, and I capture the wim file and add the newly captured wim to the sources folder of the install media, I get the error “Windows cannot find the Microsoft License Terms. Make sure the installation sources are valid and restart the installation.” Do you know what could be causing this issue? The only difference I’ve made is sysprepping the VM with the unattend.xml and replacing the existing wim file with the newly captured wim file.

    • February 8, 2019 at 21:29

      That error message simply means that there’s an error in answer file. Something is missing, not having seen your answer files I cannot answer to you.

  17. Fanie
    February 8, 2019 at 21:06

    Hey Kari, need to ask another one, I tried using serva to install this image over pxe, but can’t get it working.
    what do you use for pxe, and can you maybe create an tutorial for this. Thanks

  18. Fanie
    February 9, 2019 at 05:39

    No worries, I appreciate the answer! Thanks for everything!

  19. Jacob
    February 10, 2019 at 19:33

    Thanks for the quick response. I always validate the answer file before saving it and testing it, so I’m not sure what could be the problem. I’ve also done side by side comparisons of the answer file for 1803/1809 with my working answer file from 1709, is it possible something could be deprecated? Or maybe a licensing issue? I would be willing to share the answer file with you if you wouldn’t mind taking a look? Thanks again.

  20. Jacob
    February 11, 2019 at 16:44

    I can do that, thanks!

Leave a Reply

%d bloggers like this: