How to disable features with payload removed for Windows 11

Discussion in 'Windows 11' started by Foair, Apr 27, 2023.

  1. Foair

    Foair MDL Novice

    Jun 16, 2017
    1
    0
    0
    #1 Foair, Apr 27, 2023
    Last edited: Apr 27, 2023
    I want to chop off some features from the image to save some storage (especially helpful for VMs), but /Remove option for DISM /Disable-Feature won't work for Windows 10+ anymore as the official docs says:

    I've done some search, like this one (I tried, but didn't work for me):

    Also this question, but no answers yet:
    I'd like to hear some solutions from you, thanks!
     
  2. 100055

    100055 MDL Novice

    Dec 15, 2018
    5
    7
    0
    Bump. Looking for solutions as well.
     
  3. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    17,206
    90,782
    340
    Via NSudo
    Code:
    reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing" /v DisableRemovePayload /t REG_DWORD /d 0 /f
     
  4. 100055

    100055 MDL Novice

    Dec 15, 2018
    5
    7
    0
    This worked, thanks a lot!
     
  5. LiteOS

    LiteOS Windowizer

    Mar 7, 2014
    2,343
    1,048
    90
    is there a way to remove payload of non - feature ?
    like from other package that is not foundation
     
  6. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    17,206
    90,782
    340
  7. LiteOS

    LiteOS Windowizer

    Mar 7, 2014
    2,343
    1,048
    90
    so
    <selection name="NetFx4" state="true"/> will cause it to be in the main package - foundation
    not just its own package
    and will remove the payload

    ty
     
  8. LiteOS

    LiteOS Windowizer

    Mar 7, 2014
    2,343
    1,048
    90
    #8 LiteOS, Feb 25, 2024
    Last edited: Feb 25, 2024
    Code:
        <update name="1d14113af8def40b5599b54d974b1e73">
          <selectable disposition="absent">
            <detectNone default="true"/>
          </selectable>
          <component>
            <assemblyIdentity name="Microsoft-Windows-SenseClient-Deployment" version="10.0.26063.1" processorArchitecture="amd64" language="neutral" buildType="release" publicKeyToken="31bf3856ad364e35" versionScope="nonSxS" />
            <selection name="SenseClient" state="true"/>
          </component>
        </update>
      </package>
    </assembly>
    doesnt show in - dism /image:eek::\ /get-features /format:Table

    Error when running with packagename

    Code:
    dism /image:o:\ /get-features /format:Table /packagename:Microsoft-Windows-SenseClient-Package~31bf3856ad364e35~amd64~~10.0.26063.1
    
    Deployment Image Servicing and Management tool
    Version: 10.0.26040.1000
    
    Image Version: 10.0.26063.1
    
    An error occurred trying to open - Microsoft-Windows-SenseClient-Package~31bf3856ad364e35~amd64~~10.0.26063.1 Error: 0x800f080d
    
    Error: 0x800f080d

    after removing selection line - disabled, payload wasnt removed
    Code:
    O:\>dism /image:o:\ /disable-feature /packagename:Microsoft-Windows-SenseClient-Package~31bf3856ad364e35~amd64~~10.0.26063.1 /featurename:1d14113af8def40b5599b54d974b1e73 /remove
    
    Deployment Image Servicing and Management tool
    Version: 10.0.26040.1000
    
    Image Version: 10.0.26063.1
    
    Disabling feature(s)
    [==========================100.0%==========================]
    The operation completed successfully.
    
    O:\>dism /image:o:\ /get-features /format:Table /packagename:Microsoft-Windows-SenseClient-Package~31bf3856ad364e35~amd64~~10.0.26063.1
    
    Deployment Image Servicing and Management tool
    Version: 10.0.26040.1000
    
    Image Version: 10.0.26063.1
    
    Features listing for package : Microsoft-Windows-SenseClient-Package~31bf3856ad364e35~amd64~~10.0.26063.1
    
    -------------------------------- | --------
    Feature Name                     | State
    -------------------------------- | --------
    1d14113af8def40b5599b54d974b1e73 | Disabled
    
    The operation completed successfully.
     
  9. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    17,206
    90,782
    340
    @LiteOS
    That's not the correct way
    the "selectable" block should be add to the parent package which install the package you want to remove
    e.g. EditionPack-Package