How to Add or Remove Optional Features on Windows Install Media  

    How to Add or Remove Optional Features on Windows Install Media

    How to Add or Remove Optional Features on Windows Install Media

    Published by Category: Apps & Features
    08 Oct 2020
    Designer Media Ltd

    Ten Forums own tutorial guru @Brink has written an excellent tutorial about how to turn Windows optional features on or off in online OS, the current Windows installation user has signed in.

    This tutorial shows how to do the same on an offline image, a Windows 10 install media. Mount the install.wim file for offline servicing, add or remove optional features, and save the changes to install media. That's it.

    When this install media is then used to install Windows, all the features user prefers to be turned on are already enabled, and those user has removed will be disabled. This is much easier and faster than enabling or disabling optional features after Windows 10 has been installed.

    Please notice, that Windows 10 install media (ISO file or USB flash drive) created with Windows Media Creation Tool (MCT) is ESD based, containing install.esd file instead of install.wim. The ESD file cannot be mounted for offline servicing. You must first convert it to WIM (tutorial), or download a WIM based ISO (tutorial).






    Contents

     Click links to jump to any part



    Mount Windows image: Mount Windows image for offline servicing
    Add features: Add optional features
    Remove features: Remove optional features
    Save changes: Save changes to Windows install media




    Mount Windows image

     Mount Windows image for offline servicing



    1.) Plug in USB flash drive containing Windows install files. Alternatively, mount a Windows 10 ISO image as virtual DVD drive (right click ISO file, select Mount), and copy all its files and folders to a folder on hard disk. In this tutorial, I will use folder D:\ISO_Files as an example.

    2.) Open an elevated PowerShell (Run as administrator). Enter the following command to check which Windows editions are on your install media:

    Get-WindowsImage -ImagePath D:\ISO_Files\Sources\install.wim | Format-Table ImageIndex, ImageName
    How to Add or Remove Optional Features on Windows Install Media-get-editions.jpg
    (Click screenshots to enlarge.)

    Check the image index value for the edition you want to edit (offline service). Notice that the features will be enabled or disabled only for your selected edition; installing any other edition will not be affected.

    If you want to mount install.wim from a USB flash drive instead of a folder containing ISO files, change the -ImagePath value to X:\Sources\install.wim, where X: is the drive letter for your USB drive.

    If your ISO file or USB install media is dual architecture, containing both 32 and 64 bit Windows install files, change path accordingly. Instead of \Sources\install.wim, use either \x32\Sources\install.wim or \x64\Sources\install.wim.


    3.) Create a mount point folder. In this tutorial, I will use folder C:\Mount.

    4.) Mount selected Windows edition with following command, where X in -index X is image index number of your selected edition:

    Mount-WindowsImage -ImagePath D:\ISO_Files\Sources\install.wim -Index X -Path C:\Mount
    How to Add or Remove Optional Features on Windows Install Media-mount-selected-edition.jpg

    Change -ImagePath (path to your install.wim file) and -Path (mount point folder) according to your actual ones.



    Add features

     Add optional features



    1.) Open a list of by default disabled optional features in Windows image in so called Grid View table with following command:

    Get-WindowsOptionalFeature -Path C:\Mount | Where-Object {$_.State –eq “Disabled”} | Out-GridView -PassThru | Enable-WindowsOptionalFeature
    How to Add or Remove Optional Features on Windows Install Media-add-features.jpg

    Change the path to your actual mount point folder in -Path C:\Mount according to your actual mount point.

    If required, expand the FeatureName column in Grid View table:
    How to Add or Remove Optional Features on Windows Install Media-expand-column.jpg

    2.) Holding down the CTRL key, select the optional features you want to add to Windows image, and click OK. In this example, I have selected features Virtual Machine Platform and Windows Subsystem for Linux:
    How to Add or Remove Optional Features on Windows Install Media-select-features.jpg

    3.) Selected Windows optional features will be added to offline image.



    Remove features

     Remove optional features



    1.) Open a list of enabled optional features in Windows image in so called Grid View table with following command:

    Get-WindowsOptionalFeature -Path C:\Mount | Where-Object {$_.State –eq “Enabled”} | Out-GridView -PassThru | Disable-WindowsOptionalFeature
    How to Add or Remove Optional Features on Windows Install Media-disable-features.jpg

    Change the path to your actual mount point folder in -Path C:\Mount according to your actual mount point.

    2.) Holding down the CTRL key, select the optional features you want to remove from Windows image, and click OK. In this example, I have selected features Virtual Machine Platform and Windows Subsystem for Linux to be removed:
    How to Add or Remove Optional Features on Windows Install Media-disable-features.jpg

    3.) Selected Windows optional features will be removed from offline image.



    Save changes

     Save changes to Windows image



    1.) Enter the following command to save changes to your Windows install media:

    Dismount-WindowsImage -Path C:\Mount -Save
    How to Add or Remove Optional Features on Windows Install Media-dismount-image.jpg

    Change the path to your mount point according to the actual one.

    2.) Optional Windows features in selected Windows edition have been added or removed as you selected. When the selected edition of Windows 10 is installed from your install media, all selected features added will be enabled by default.

    If you added features to a USB install media, or removed features from it, it's ready now. If you had copied ISO files to a folder, you must now create a new ISO from updated files and folders in that folder. You can use whatever ISO creating method you'd prefer. See steps 5.3 to 5.5 in this tutorial for one method to create new ISO: Create Windows 10 ISO image from Existing Installation

    That's it, geeks. You might want to read my article about Out-Gridview PowerShell cmdlet used in this tutorial: Out-Gridview – Most versatile PowerShell cmdlet?

    Kari



  1. Posts : 100
    Windows 10 21H2/Windows 11 21H2 (22000.100)
       #1

    Beautiful instructions, is it possible to remove applications in a similar way?

    How to Add or Remove Optional Features on Windows Install Media-aplikace.png

    +OneDrive + Cortana atd?

    Thank you for your time and answer.
      My Computer


  2. Posts : 68
    MS Win10 + Remnux Linux OS Dual Boot
       #2

    Complete Set of Powershell Commands i use on Online System are as Follows :

    echo *****************************************************************
    echo --- Remove All Windows Apps
    echo *****************************************************************

    Powershell -Command "Get-AppxProvisionedPackage -Online | Out-GridView -PassThru -Title 'Select All Windows Apps to Remove' | Remove-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue -Verbose"

    echo *****************************************************************
    echo.
    echo *****************************************************************
    echo --- Remove All System Apps for All Users
    echo *****************************************************************

    Powershell -Command "Get-AppxPackage -AllUsers | Out-GridView -PassThru -Title 'Select All System Apps to Remove' | Remove-AppxPackage -Confirm:$false -ErrorAction SilentlyContinue -Verbose"

    echo *****************************************************************
    echo.
    echo *****************************************************************
    echo --- Select and Disable UnNeeded Windows Features
    echo *****************************************************************

    Powershell -Command "Get-WindowsOptionalFeature -Online | Where-Object {$_.State -eq 'Enabled' } | Out-GridView -PassThru -Title 'Select Windows Optional Features to Disable' | Disable-WindowsOptionalFeature -Online -Verbose"

    echo *****************************************************************
    echo.
    echo *****************************************************************
    echo --- Select and Remove UnNeeded Windows Capabilities
    echo *****************************************************************

    Powershell -Command "Get-WindowsCapability -Online | Where-Object {$_.State -eq 'Installed' } | Out-GridView -PassThru -Title 'Select Windows Capabilities to Remove' | Remove-WindowsCapability -Online -Verbose"

    echo *****************************************************************
    echo.
    echo *****************************************************************
    echo --- Select and Remove UnNeeded Windows Packages
    echo *****************************************************************

    Powershell -Command "Get-WindowsPackage -Online | Where-Object {$_.PackageState -eq 'Installed' } | Out-GridView -PassThru -Title 'Select Windows Packages to Remove' | Remove-WindowsPackage -Online -Verbose"

    echo *****************************************************************
      My Computer


  3. Posts : 100
    Windows 10 21H2/Windows 11 21H2 (22000.100)
       #3

    Thank you, I will try
      My Computer


  4. Posts : 68
    MS Win10 + Remnux Linux OS Dual Boot
       #4

    Some More Pwsh Commands i use on my Win10 VM ======>

    PowerShell -Command "Write-Host 'Disable WMI Autologgers' -ForegroundColor Green"
    PowerShell -Command "Get-AutologgerConfig | Out-GridView -PassThru -Title 'Select All Autologgers to Disable' | Set-AutologgerConfig -Start 0 -InitStatus 0 -Confirm:$false -ErrorAction Ignore -Verbose"
    echo.
    PowerShell -Command "Write-Host 'Remove All Scheduled Tasks' -ForegroundColor Green"
    Powershell -Command "Get-Scheduledtask | Out-GridView -PassThru -Title 'Select All Scheduled Tasks to Remove' | Unregister-ScheduledTask -Confirm:$false -ErrorAction SilentlyContinue -Verbose"
    echo.
    PowerShell -Command "Write-Host 'Remove All Firewall Rules' -ForegroundColor Green"
    Powershell -Command "Get-NetFirewallRule | Out-GridView -PassThru -Title 'Select All Firewall Rules to Remove' | Remove-NetFirewallRule -Confirm:$False -ErrorAction SilentlyContinue -Verbose"
    echo.
    PowerShell -Command "Write-Host 'Tweak to Disable All Windows Event Logs' -ForegroundColor Green"
    PowerShell -Command "$key = 'HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Channels'; Get-ChildItem $key | foreach { Set-ItemProperty -Path "$key\$($_.pschildname)" -Name Enabled -Value 0 -ErrorAction SilentlyContinue -Verbose }"
      My Computer


  5. Posts : 1
    20H2
       #5

    Online to Image


    I'm missing something in the syntax between the commands you have in the main tutorial (for an offline image) and the ones you have further down in the thread. Can you close the gap please?
      My Computer


 

Tutorial Categories

How to Add or Remove Optional Features on Windows Install Media Tutorial Index Network & Sharing Instalation and Upgrade Browsers and Email General Tips Gaming Customization Apps and Features Virtualization BSOD System Security User Accounts Hardware and Drivers Updates and Activation Backup and Restore Performance and Maintenance Mixed Reality Phone


  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 17:23.
Find Us




Windows 10 Forums