Add Applications in Answer File Windows 10

Page 1 of 2 12 LastLast

  1. Posts : 4
    Window 10 Professional

    Add Applications in Answer File Windows 10

    Dear Everyone,

    I am trying to add applications and Drivers to answer File (Win 10 22H2) using Windows System Image Manager anyone can guide me how to do it, I searched on Microsoft Website but couldn't find the Steps.

    Thanks & Regards
      My Computer

  2. Posts : 4,185
    Windows 11 Pro, 22H2


    Take a look at the tutorial that I have linked to below. I believe that it contains most of what you need. Note that in this procedure, you still have an answer file (actually 2 of them), but the installation of applications is done by creating a so-called "reference system" onto which you would install all your applications and make any modifications to the Windows installation that you wish, then you would capture this customized image. Here is a brief summary of how you would accomplish this:

    1) Create two answer files.
    2) Install Windows on a Reference System. That system could be a physical machine or a virtual machine.
    3) Modify Windows however you like. Change the appearance of Windows, make registry changes, modify various settings in Windows to get it just how you like, etc.
    4) Capture an image of your reference system.
    5) Create a new ISO image or installation media in which you replace the standard Windows INSTALL.WIM file with your custom image.

    IMPORTANT: Since your reference system may be a completely different system than the system(s) to which you will be installing Windows (or it may even be a VM), you should handle the drivers differently. One strategy would be to inject all the drivers that you need into the Windows image. It will take me a little while to write a procedure for that, so please bear with me. I will post another response here with that procedure.

    If you have any additional questions, please do let me know.

    Link to tutorial:

    Create media for automated unattended install of Windows 10
      My Computers

  3. Posts : 4,185
    Windows 11 Pro, 22H2

    Faisal, a couple of questions for you so that I make the best suggestions for your case:

    1) Will you be using this unattended installation with multiple systems?

    2) If you are planning to use it with multiple systems, will these systems all be the same or will they be different systems that have different drivers?
      My Computers

  4. Posts : 4,185
    Windows 11 Pro, 22H2


    Another idea: You may be able to make use of the "SetupComplete.cmd" file to run application installers and install your drivers at the end of setup. Take a look at this article for details:
      My Computers

  5. Posts : 4,185
    Windows 11 Pro, 22H2


    If you plan to install Windows to systems that all need the same drivers, then maybe the best strategy would be to simply inject those drivers into your Windows image. However, if you are going to install to systems that need different drivers, it might be easier to install the drivers after installation. What I typically do is this:

    1) I export all the drivers from a system that is working. This requires only one command to accomplish.

    2) I install Windows on a machine. This could be either a manual installation, an unattended installation of a standard Windows image, or even an unattended installation of a customized Windows image.

    3) After Windows is installed, you can install ALL the drivers for that system by either running a single command that will re-import the drivers that you previouosly exported, or you can install those drivers through Device Manager.

    Part 1 of the procedure below will show you how to export the drivers and then reinstall them after installation as I described above.

    Part 2 of the procedure will show you how to inject those drivers into your Windows image.

    NOTE: Since all the drivers can be installed with a single command, it's possible that we could modify the unattended answer file to run that command and install the drivers at the end of installation. I'm going to test that to see if I can make it work. I will most likely need until tomorrow to try this.


    Part 1 - This will show you how to export and save all your drivers, then reinstall them after a clean install. This procedure is extremely simple and fast.

    Part 2 - This is a procedure that will show you how to customize your Windows media to include all the drivers for your system. This procedure has quite a few steps, but I'll guide you through them step-by-step. It's easy, but some of the steps can be a little time consuming and requires you to install the Windows ADK (Assessment and Deployment Kit).

    * PART 1 - Make a Backup Copy of Your Drivers and *
    * Re-install Them After a Clean Install of Windows *

    We'll start by making a backup of all the drivers on your system. Just follow these steps:

    1) Open a command prompt as administrator.

    2) Create a folder to which you can save your drivers and export your system drivers by running the commands below. That folder can be on your internal drive, an external drive, a thumb drive, etc. In the example below, note that I am using C:\Project\Exported_Drivers:

    MD "C:\Project\Exported_Drivers"
    pnputil /export-driver * "C:\Project\Exported_Drivers"

    3) You should now copy the Exported_Drivers folder to a USB Flash Drive (UFD), external drive, etc. so that it will be available to you in the future if you reinstall Windows, or if your hard disk crashes, etc.

    That is all! The next steps show you how to reinstall the drivers after you perform a clean install.

    4) Assuming that you have already reinstalled Windows, plug in the drive or UFD on which you have the previously exported drivers.

    5) Do either one of these:

    A) Open Device Manager, at the top of the device tree, right-click on the computer name, select "Add Drivers", browse to the location where you have the saved drivers, check the box that says "Include subfolders", click on "Next".


    B) Open an elevated command prompt and run this command:

    pnputil /add-driver "D:\Exported_Drivers\*.inf" /subdirs /install

    NOTE: D:\Exported_Drivers is the location of the drivers. Change this to the location where you have the drivers. Please also note that this may take several minutes and that the screen may flash or go blank temporarily at the point where the display drivers are being installed. This is normal.

    Done! That's all there is to reinstalling all your system drivers.

    * PART 2 - Inject Drivers Into Your Windows Image *

    1) Start by following steps 1 - 3 of the PART 1 procedure above. This will export all of the drivers from your system. Once you have completed those steps, come back here and continue with step 2 below.

    2) Create a folder to which you can copy the contents of your Windows install media. In this example, I will use "C:\Project\ISO_Files".

    3) Create another folder to which we can temporarily mount the Windows "install.wim" file. I will use "C:\Project\Mount".

    IMPORTANT: Microsoft distributes Windows images that may contain a file named "install.wim" or it may contain a file named "install.esd". This procedure will use a Microsoft utility called "DISM" which requires that you have an image with an install.wim, not an install.esd.

    To check which file your image has has follow these steps:

    A) Double-click the ISO image file. This will mount it to a drive letter, much like inserting a DVD into a DVD drive on your computer.

    B) In File Explorer, look at the drive letter to which your ISO image was mounted and go into the "sources" folder. Within that folder you will find either an install.wim or an install.esd file.

    C) If you see an install.wim file, skip to step "F" below. If you see an install.esd file, continue with step "D".

    D) Go to the Microsoft Windows 11 download page located here:

    E) Skip down to the section that says "Download Windows 11 Disk Image (ISO) for x64 devices", make a selection in the box that says "Select Download", then click on the "Download" button. Select the desired language and then click on "Confirm". This will download an ISO image with an install.wim file.

    F) You can now unmount the image that I asked you to mount in step A. To do so, in File Explorer, find the drive letter of the mounted image, right-click it, and choose "Eject".

    4) We will now install the Windows ADK (Assessment and Deployment Kit). You can install it from here:

    NOTE: When installing the ADK, you will be shown a list of items that can be installed. You can choose to install only the Deployment Tools from this list. This makes the install quick and very small.

    5) Open a command prompt by running the "Deployment and Imaging Tools Environment" in elevated mode (as Administrator). You will find this item in Start > All Apps > Windows Kits. Again, make sure to run this elevated (as Administrator).

    TIP: When you open the Deployment and Imaging Tools Environment, you can issue a "CD " to change paths to the root of the volume. This makes the prompt at the command line much shorter and less obtrusive while you are working. Leave this window open until the very end. We will run all of the needed commands from the Deployment and Imaging Tools Environment.

    NOTE: This environment is basically like any other command prompt, except that various variables and paths are set so that the tools we need such as DISM.exe and OSCDIMG.exe are in the path, ensuring that the latest version of these utilities is run from the ADK location.

    6) We will now create the folders that we need for this project by running these commands. Note that you should have already created some of these folders in the above steps so running these commands my give you an error message stating that those folders already exist. That's perfectly okay.

    MD "C:\Project\ISO_Files"
    MD "C:\Project\Mount"
    MD "C:\Project\Exported_Drivers"

    7) At this point, I would strongly suggest creating an exception for C:\Project in your antivirus software. I have seen many cases of problems with this procedure completing successfully if this is not done. As an alternative, you could temporarily disable real-time virus scanning until you are done.

    If you are using Windows Security, you can set an exclusion by going here (this assumes Win 11 22H2): Settings > Privacy & security > Windows security > Open Windows Security > Virus and threat protection > Under "Virus and threat protection settings" select "Manage settings" > Add or remove exclusions.

    For other AV programs, see instructions for that software.

    8) Copy or move all the drivers that you exported earlier to C:\Project\Exported_Drivers.

    9) Mount your Windows ISO image by double clicking it in File Explorer. Copy ALL files and folders from that image to C:\Project\ISO_Files.

    10) Unmount the Windows image. You can do this by going into File Explorer and opening "This PC". Right-click on the drive letter for your mounted Windows image, select Eject.

    11) We now need to determine what edition of Windows you have on your PC and where this edition is located in your Windows image. Begin by going Windows Settings > System > About. Under the "Windows specifications" section it will list the "Edition". In all liklihood, this will be either Windows 11 Home or Windows 11 Pro. Take note of the edition that you have installed.

    12) Check what editions are available in your Windows image by running this command:

    DISM /Get-WimInfo /WimFile:"C:\Project\ISO_Files\Sources\install.wim"

    You should see output that looks something like this:

    Deployment Image Servicing and Management tool
    Version: 10.0.22621.1

    Details for image : C:\Project\ISO_Files\Sources\install.wim

    Index : 1
    Name : Windows 11 Home
    Description : Windows 11 Home
    Size : 16,168,829,996 bytes

    Index : 2
    Name : Windows 11 Home N
    Description : Windows 11 Home N
    Size : 15,506,889,019 bytes

    Index : 3
    Name : Windows 11 Home Single Language
    Description : Windows 11 Home Single Language
    Size : 16,153,401,297 bytes

    Index : 4
    Name : Windows 11 Education
    Description : Windows 11 Education
    Size : 16,463,631,301 bytes

    Index : 5
    Name : Windows 11 Education N
    Description : Windows 11 Education N
    Size : 15,808,633,936 bytes

    Index : 6
    Name : Windows 11 Pro
    Description : Windows 11 Pro
    Size : 16,479,089,353 bytes

    Note that the above is only a partial output, but it is enough for me to explain what we are looking for. Note that each edition of Windows has a unique index number. In the above example, Windows 11 Home is index 1 and Windows 11 Pro is index 6. Make a note of the index number associated with the edition of Windows that is installed on your system as you determined above in step 11. In the steps that follow, I am making the assumption that you have Windows 11 Pro which in the output above corresponds with index 6. As a result, I will use index 6 for any commands that reference an index number. Please alter this if you need to do so for your specific situation.

    13) Mount the install.wim by running the command below. Remember to change the index number if needed to match your situation.:

    DISM /Mount-Image /ImageFile:"C:\Project\ISO_Files\Sources\install.wim" /Index:6 /MountDir:"C:\Project\Mount"

    Wait for the image to be mounted, then continue to step 14.

    14) Inject the drivers by running this command:

    DISM /Image:"C:\Project\Mount" /Add-Driver /Driver:"C:\Project\Exported_Drivers" /Recurse

    When completed, continue with step 15.

    15) Unmount the image:

    DISM /Unmount-Image /MountDir:"C:\Project\Mount" /Commit

    Once done unmounting, continue to step 16.

    16) Make final ISO image:

    Caution: This is a long command and there places in the command where you may be tempted to add a space where no space should be used. To avoid errors I sugest copying and pasting this command, then modify if needed before running the command. Also, read the note below the command before you actually run it.

    oscdimg -m -o -u2 -udfver102 -l"Win 11 for Mini PC" -bootdata:2#p0,e,b"c:\Project\ISO_Files\boot\"#pEF,e,b"c:\Project\ISO_Files\efi\microsoft \boot\efisys.bin" "c:\Project\ISO_Files" "c:\Project\Windows.iso"

    NOTE: The "Win 11 for Mini PC" is the volume name that will be assigned to the image. You can replace this text with anything that you want, just be aware that you are limited to 32 characters. Also, Windows.iso is the name that we are giving the ISO image file that we are creating. You can change that name to anything you want.

    Status Check

    At this point you have a new Windows image that includes the drivers for your system. Please note that even if the original Windows image had multiple editions of Windows (Windows Home, Pro, etc.), the new image will contain ONLY the image associated with the index number that you specified in the commands above. For example, if you injected the drivers into Windows 11 Pro, your new image will contain ONLY Windows 11 Pro. Also, in that new ISO image, since we only have a single Windows edition, that edition of Windows will have an index of 1. This is not critical to remember, just something that you may wish to know.

    I suggest copying or moving C:\Project\Windows.ISO (or whatever you named it) to a location where you can safely keep it. Once you have done so, you can delete the folder C:\Project along with all files and subfolders.

    In the next steps, you will create a bootable USB Flash Disk (UFD). To do this, follow these steps:

    17) Select a flash drive of at least 8 GB in size and no larger than 2 TB and plug it into a USB port.

    IMPORTANT: Make sure there is nothing you need to keep on this UFD - all data on it will be erased!

    18) Run the following command:


    Once diskpart has started, run this command:

    list disk

    From the size of the disks, try to determine which disk ID is your thumb drive. If that is not enough information, run these commands to get more detail on the disk. In this example, I want more info on disk 4:

    select disk 4
    detail disk

    Here is some sample output:

    DISKPART> list disk

    Disk ### Status Size Free Dyn Gpt
    -------- ------------- ------- ------- --- ---
    Disk 0 Online 476 GB 0 B *
    Disk 1 Online 3726 GB 0 B *
    Disk 2 Online 465 GB 1024 KB *
    Disk 3 Online 7452 GB 0 B *
    Disk 4 Online 238 GB 0 B

    DISKPART> select disk 4

    Disk 4 is now the selected disk.

    DISKPART> detail disk

    SanDisk Extreme Pro USB Device
    Disk ID: DC727760
    Type : USB
    Status : Online
    Path : 0
    Target : 0
    LUN ID : 0
    Location Path : UNAVAILABLE
    Current Read-only State : No
    Read-only : No
    Boot Disk : No
    Pagefile Disk : No
    Hibernation File Disk : No
    Crashdump Disk : No
    Clustered Disk : No

    Volume ### Ltr Label Fs Type Size Status Info
    ---------- --- ----------- ----- ---------- ------- --------- --------
    Volume 7 Z My Software NTFS Removable 238 GB Healthy
    C:\MountPoints\My Software\

    When you determine the correct disk, run the commands below. I am assuming disk 5 in the following example, but make sure to substitute the correct number for your UFD. Please also note that there is an issue with diskpart where you may get an error message after you run the "clean" command. If that happens, simply run "clean" a second time. Finally, the "assign" commands will assign the next available drive letter. If you want to assign specific drives letters, for example E:, use the command "assign letter=E".

    IMPORTANT: Once again, make sure you select the correct disk number because these commands will wipe the contents of the disk that you select. If you are not certain, you can close the command prompt to abort the procedure now.

    select disk 5
    convert mbr
    create partition primary size=2000
    format fs=fat32 quick
    create partition primary
    format fs=ntfs quick

    19) Double-click the ISO image file that we created earlier (Windows.ISO) in File Explorer. This will mount that image to a drive letter. Take note of the drive letter to which it is mounted. In the commands below, I am using the drive letter H:.

    20) We will now copy files from the source to the two partitions on the thumb drive. To be clear, all the files and folders that you are being asked to copy come from your mounted ISO image (H: in this example). Make sure to use the correct letter in place of H: for your situation.

    Create a text file called ei.cfg. We will use that below. Place the following 2 lines into that file:


    Notes about ei.cfg: Let's say that you have a computer that shipped with Windows Home edition, but you upgraded to Pro. You may find that when you try to perform a clean install, Windows simply starts installing Home and doesn't even show you the menu from which you can select other editions. By placing this file in the sources folder, we prevent that from happening. This happens because Windows setup reads a signature in the BIOS that tells setup which edition of Windows the system was shipped with. This is especially important in cases like this where we only have a single edition of Windows in the image. You want to make sure that this edition is available when installing from your media.

    Follow these steps to copy files to your thumb drive:

    • Copy all files and folders EXCEPT the \sources folder to the FAT32 partition (the first, smaller partition).

    • Create a folder called sources on the FAT32 partition.

    • Copy the file \sources\boot.wim to the FAT32 partition \sources folder.

    • Create a folder called sources on the NTFS partition (the second, larger partition).

    • Copy all files and folders from the \sources folder EXCEPT boot.wim to the \sources folder on the NTFS partition.

    • Copy the ei.cfg file that you created to the \sources folder of the NTFS partition.

    Done! At this point, you should have a bootable thumb drive.

    NOTE: When booting you may be presented with an option to boot either the FAT32 or the NTFS partition. Choose the FAT32 partition. If it is not clear which one the FAT32 partition is, simply try either. If it doesn't work, reboot and try the other. Usually, the FAT32 partition will be the first or only partition shown by your system.

    At this time, feel free to reenable your Antivirus software if you disabled it. If you set an exclusion, you can delete that exclusion now if you wish to do so.

    If you encounter any difficulties, please let me know and I will be happy to help.
      My Computers

  6. Posts : 4
    Window 10 Professional
    Thread Starter

    Dear hsehestedt Sir,

    I would like to thank you for your detailed explanation you have given about the topic and I missed couple of things, First I have created answer it's ok but there is something called distribution share and configuration Set by which we can add drivers, packages and applications in Answer File and I am looking for solution about these two steps how to add even when installing windows 10 using USB, couldn't find solution on Internet
      My Computer

  7. Posts : 4,185
    Windows 11 Pro, 22H2

    You may be teaching me something new. I was not familiar with "Distribution Share" and "Configuration Set". Let me try to do some research myself and see if I can find anything. I'll report what I find. However, the fact that you found nothing on the Internet worries me because that is exactly what I will need to do.
      My Computers

  8. Posts : 755
    Windows 7

    Distribution share is MS speak for grabbing files from a network share with provided credentials. You include that in the answer file instead of using explicit "net" commands in SynchronousCommand.
      My Computer

  9. Posts : 4,185
    Windows 11 Pro, 22H2

    Faisal, did you already look at this documentation from Microsoft on that topic?
      My Computers

  10. Posts : 4,185
    Windows 11 Pro, 22H2

    garlin said:
    Distribution share is MS speak for grabbing files from a network share with provided credentials. You include that in the answer file instead of using explicit "net" commands in SynchronousCommand.
    Thanks, garlin. I'm trying to educate myself on this topic right now. It sounds like you may have some experience with this. If you don't mind, could you continue to monitor this thread? I may have some questions as I continue my research.
      My Computers


  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 02:01.
Find Us

Windows 10 Forums