Slimdown11 – turn Windows 11 or LTSC 2024 into classic/legacy Windows

Discussion in 'Windows 11' started by SunLion, Mar 2, 2025.

  1. SunLion

    SunLion MDL Expert

    May 11, 2011
    1,634
    6,111
    60
    Please try changing the line below and test it:

     
  2. sainfo

    sainfo MDL Addicted

    Dec 6, 2021
    653
    1,445
    30
    Thank you very much, I will definitely test this version of your code.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. ahczwudichao

    ahczwudichao MDL Junior Member

    May 1, 2013
    97
    82
    0
    hi @wuliyen, does this ps1 script does the job or could you share yours please ?

    Code:
    # Define a function to convert wildcard patterns to regex
    function Convert-WildcardToRegex {
        param($pattern)
        $regex = [regex]::Escape($pattern) -replace '\\\*', '.*'
        return $regex
    }
    
    # Define paths
    $sourceDirectory = "C:\TEMP\scratchdir\Windows\WinSxS"
    $destinationDirectory = "C:\TEMP\scratchdir\Windows\WinSxS_edit"
    $manifestSource = Join-Path -Path $sourceDirectory -ChildPath "Manifests"
    $manifestDest = Join-Path -Path $destinationDirectory -ChildPath "Manifests"
    
    # Define the list of directory patterns to retain in WinSxS
    $dirsToCopy = @(
        "amd64_microsoft-windows-deployment_*",
        "amd64_microsoft-windows-g..ntservice.resources_*_zh-cn_*",
        "amd64_microsoft-windows-international-core_*",
        "amd64_microsoft-windows-p..ing-lpdprintservice_*",
        "amd64_microsoft-windows-p..ntservice.resources_*_zh-cn_*",
        "amd64_microsoft-windows-p..rtmonitor.resources_*_zh-cn_*",
        "amd64_microsoft-windows-p..ting-lprportmonitor_*",
        "amd64_microsoft-windows-printing-powershell_*",
        "amd64_microsoft-windows-security-spp-ux_*",
        "amd64_microsoft-windows-servicingstack_*",
        "amd64_microsoft-windows-shell-setup_*",
        "amd64_microsoft-windows-tapicore.resources_*_zh-cn_*",
        "amd64_microsoft-windows-tapicore_*",
        "amd64_microsoft-windows-unattendedjoin_*",
        "amd64_microsoft-windows-userdeviceregistration_*",
        "amd64_microsoft.vc80.*",
        "amd64_microsoft.vc90.*",
        "amd64_microsoft.windows.c..-controls.resources_*_5.82.*_zh-cn_*",
        "amd64_microsoft.windows.c..-controls.resources_*_6.0.*_zh-cn_*",
        "amd64_microsoft.windows.common-controls_*_5.82.*",
        "amd64_microsoft.windows.common-controls_*_6.0.*",
        "amd64_microsoft.windows.gdiplus_*",
        "amd64_microsoft.windows.i..utomation.proxystub_*",
        "amd64_microsoft.windows.isolationautomation_*",
        "wow64_microsoft-windows-printing-powershell_*",
        "wow64_microsoft-windows-tapicore.resources_*_zh-cn_*",
        "wow64_microsoft-windows-tapicore_*",
        "x86_microsoft.vc80.*",
        "x86_microsoft.vc90.*",
        "x86_microsoft.windows.c..-controls.resources_*_5.82.*_zh-cn_*",
        "x86_microsoft.windows.c..-controls.resources_*_6.0.*_zh-cn_*",
        "x86_microsoft.windows.common-controls_*_5.82.*",
        "x86_microsoft.windows.common-controls_*_6.0.*",
        "x86_microsoft.windows.gdiplus_*",
        "x86_microsoft.windows.i..utomation.proxystub_*",
        "x86_microsoft.windows.isolationautomation_*"
    )
    
    # Define the list of file patterns to retain in WinSxS\Manifests
    $filesToCopy = @(
        "amd64_microsoft-windows-com-dtc-runtime_*",
        "amd64_microsoft-windows-coreos-revision_*",
        "amd64_microsoft-windows-deployment_*",
        "amd64_microsoft-windows-enhancedstorage-adm_*",
        "amd64_microsoft-windows-explorer_*",
        "amd64_microsoft-windows-g..ntservice.resources_*",
        "amd64_microsoft-windows-i..national-core-winpe_*",
        "amd64_microsoft-windows-international-core_*",
        "amd64_microsoft-windows-p..ing-lpdprintservice_*",
        "amd64_microsoft-windows-p..ntservice.resources_*",
        "amd64_microsoft-windows-p..rtmonitor.resources_*",
        "amd64_microsoft-windows-p..ting-lprportmonitor_*",
        "amd64_microsoft-windows-printing-powershell_*",
        "amd64_microsoft-windows-r..-service.deployment_*",
        "amd64_microsoft-windows-security-spp-ux_*",
        "amd64_microsoft-windows-servicingstack_*",
        "amd64_microsoft-windows-setup_*",
        "amd64_microsoft-windows-shell-setup_*",
        "amd64_microsoft-windows-unattendedjoin_*",
        "amd64_microsoft.vc80.*",
        "amd64_microsoft.vc90.*",
        "amd64_microsoft.windows.c..-controls.resources_*_5.82.*_zh-cn_*",
        "amd64_microsoft.windows.c..-controls.resources_*_6.0.*_zh-cn_*",
        "amd64_microsoft.windows.common-controls_*_5.82.*",
        "amd64_microsoft.windows.common-controls_*_6.0.*",
        "amd64_microsoft.windows.gdiplus_*_1.0.*",
        "amd64_microsoft.windows.gdiplus_*_1.1.*",
        "amd64_microsoft.windows.i..utomation.proxystub_*",
        "amd64_microsoft.windows.isolationautomation_*",
        "amd64_microsoft.windows.systemcompatible_*",
        "amd64_policy.8.0.microsoft.vc80.*",
        "amd64_policy.9.0.microsoft.vc90.*",
        "wow64_microsoft-windows-printing-powershell_*",
        "wow64_microsoft.windows.gdiplus.systemcopy_*",
        "x86_microsoft.vc80.*",
        "x86_microsoft.vc90.*",
        "x86_microsoft.windows.c..-controls.resources_*_5.82.*_zh-cn_*",
        "x86_microsoft.windows.c..-controls.resources_*_6.0.*_zh-cn_*",
        "x86_microsoft.windows.common-controls_*_5.82.*",
        "x86_microsoft.windows.common-controls_*_6.0.*",
        "x86_microsoft.windows.gdiplus_*_1.0.*",
        "x86_microsoft.windows.gdiplus_*_1.1.*",
        "x86_microsoft.windows.i..utomation.proxystub_*",
        "x86_microsoft.windows.isolationautomation_*",
        "x86_microsoft.windows.systemcompatible_*",
        "x86_policy.8.0.microsoft.vc80.*",
        "x86_policy.9.0.microsoft.vc90.*"
    )
    
    # Convert patterns to regex for efficient matching
    $dirRegex = ($dirsToCopy | ForEach-Object { Convert-WildcardToRegex $_ }) -join "|"
    $fileRegex = ($filesToCopy | ForEach-Object { Convert-WildcardToRegex $_ }) -join "|"
    
    # Create the destination directory
    New-Item -Path $destinationDirectory -ItemType Directory -Force
    
    # Copy retained directories from WinSxS
    $sourceDirs = Get-ChildItem -Path $sourceDirectory -Directory | Where-Object { $_.Name -match $dirRegex }
    foreach ($sourceDir in $sourceDirs) {
        $destDir = Join-Path -Path $destinationDirectory -ChildPath $sourceDir.Name
        Write-Host "Copying $($sourceDir.FullName) to $destDir"
        Copy-Item -Path $sourceDir.FullName -Destination $destDir -Recurse -Force
    }
    
    # Create Manifests directory in the destination and copy retained files
    New-Item -Path $manifestDest -ItemType Directory -Force
    $manifestFiles = Get-ChildItem -Path $manifestSource -File | Where-Object { $_.Name -match $fileRegex }
    foreach ($file in $manifestFiles) {
        Write-Host "Copying $($file.FullName) to $manifestDest"
        Copy-Item -Path $file.FullName -Destination $manifestDest -Force
    }
    
    # Delete the original WinSxS folder
    Write-Host "Deleting WinSxS. This may take a while..."
    Remove-Item -Path $sourceDirectory -Recurse -Force
    
    # Rename the temporary directory to replace WinSxS
    Rename-Item -Path $destinationDirectory -NewName "WinSxS"
    Write-Host "Complete!"
     
  4. wuliyen

    wuliyen MDL Member

    Oct 6, 2009
    199
    476
    10
    Change this to your language code, _zh-cn_.
    Rename WinSxS folder
    New WinSxS folder
    Delete renamed folder after copying files
     
  5. SunLion

    SunLion MDL Expert

    May 11, 2011
    1,634
    6,111
    60
    Good afternoon

    I don't know if you managed to solve the problem...

    I made some adjustments here. Try these and see if it works well for you.

    no password
     

    Attached Files:

  6. sainfo

    sainfo MDL Addicted

    Dec 6, 2021
    653
    1,445
    30
    Good day, so far I haven't been able to solve the problem. Thank you very much, I'll try your version of the script.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. sainfo

    sainfo MDL Addicted

    Dec 6, 2021
    653
    1,445
    30
    SunLion,
    I tested this version of the script, everything is fine - The operation completed successfully.
    Thank you very much for your efforts!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. Mavericks Choice

    Mavericks Choice MDL Guru

    Aug 5, 2015
    4,297
    16,745
    150
    @SunLion have tested fixed in a vm working perfectly here. Cheers.
     
  9. sainfo

    sainfo MDL Addicted

    Dec 6, 2021
    653
    1,445
    30
    I tried to make a build with a SunLion tool based on 26100.1742 with Windows11.0-KB5054156-x64.msu and Windows11.0-KB5054148-x64.msu updates, supposedly promising to be 25H2. But in fact, it turned out to be Windows 11 IoT 24H2 LTSC [26200.5510] x64 RU without any special changes. Judging by the update size of 3.8 Gb, I hoped that it would be something completely new, but in fact - everything is the same!
    :thinking:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. SunLion

    SunLion MDL Expert

    May 11, 2011
    1,634
    6,111
    60
    I believe that to change to 25H2 they should release a new enablement

    See here:
    https://forums.mydigitallife.net/threads/windows-11-hotfix-repository.83741/page-144#post-1874226
     
  11. sainfo

    sainfo MDL Addicted

    Dec 6, 2021
    653
    1,445
    30
    I see, well I wasn't interested in this topic at all, and then I see an update for 26100.1742 to get 26200.xxx. Judging by the size of the update of 3.8 GB, I hoped that it would be a completely new OS. But it turned out that it was the same modified ten from 2009. It is not clear what they updated there with such a huge, in size, update?!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. SunLion

    SunLion MDL Expert

    May 11, 2011
    1,634
    6,111
    60
    Unfortunately, Windows 11 has been growing in size with each update. Lots of crap...
     
  13. sainfo

    sainfo MDL Addicted

    Dec 6, 2021
    653
    1,445
    30
    Yes, but we are actively fighting this, thanks to your wonderful tool - keep it up!
    :shake:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  14. Mavericks Choice

    Mavericks Choice MDL Guru

    Aug 5, 2015
    4,297
    16,745
    150
    Question about drivers not sure if SD addresses them?
     
  15. sainfo

    sainfo MDL Addicted

    Dec 6, 2021
    653
    1,445
    30
    #115 sainfo, Mar 28, 2025
    Last edited: Mar 28, 2025
    It is not entirely clear who the question is for and what you meant by the question about drivers?

    Personally, I have no problems with drivers. With the OS installed, I use a script to create an archive of all drivers installed in the system in a folder on the "D" partition, and after installing the newly installed OS, I use another script to install them all at once. It's fast and very convenient, in my opinion.
    Backup of system drivers

    1. Create a Drivers folder on disk "D"

    Code:
    C:\Users\Alex>D:
    D:\>cd D:
    md D:\Drivers
    2. Create a backup of drivers in the Drivers folder on disk "D"

    Code:
    dism /online /export-driver /destination:D:\Drivers
    3. After that, a copy of your system drivers will appear on disk D. After reinstalling the system, enter the following in the command line as an administrator:

    Code:
    pnputil.exe /add-driver D:\Drivers\*.inf /subdirs /install
    4. As a result, within a few minutes you will receive a system with working drivers for your machine.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  16. SunLion

    SunLion MDL Expert

    May 11, 2011
    1,634
    6,111
    60
    Good tip!

    Thanks!
     
  17. Mavericks Choice

    Mavericks Choice MDL Guru

    Aug 5, 2015
    4,297
    16,745
    150
    Thank you I was looking at which unnecessary drivers can be removed in the offline image.
     
  18. sainfo

    sainfo MDL Addicted

    Dec 6, 2021
    653
    1,445
    30
    By the way, if you place this .cmd file, in your case, in the $OEM$\$$\Setup\BAT\ folder, then the process of installing previously saved drivers can be made automatic. That is, they will be installed during the OS installation from the previously saved Drivers folder.
    Code:
    @echo off
    for %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (if exist "%%i:\Drivers" set "Drivers=%%i:\Drivers")
    pnputil.exe /add-driver "%Drivers%\*.inf" /subdirs /install
    exit /b
    
    But there is one BUT: earlier, on versions 23H2 and earlier versions of 24H2 I successfully used this script and it worked without any issues. But on the latest versions of 24H2 for some reason it does not want to work - the installation process hangs at the place where this script is being processed. Why, I do not know and do not understand. Since you have much more experience in scripts than I do, perhaps you see the reason for this installation hang on the latest versions of 24H2 in this code?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  19. rayman95

    rayman95 MDL Senior Member

    Oct 3, 2018
    419
    289
    10
    Double driver or driver backup make a backup, and you can on a one shot, restore them .
     
  20. SunLion

    SunLion MDL Expert

    May 11, 2011
    1,634
    6,111
    60
    I'll try to create an automatic installer and make it available for you to test.
    My logic would be to unzip the script to a folder in C:\ and the script would be executed from there, removing everything at the end.
    A few experiments here work well.
    Let's see...
    I need you to tell me the path to the Drivers folder in your case, please.