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

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

  1. jagoanku

    jagoanku MDL Junior Member

    Jun 6, 2026
    51
    107
    0
    #2281 jagoanku, Sep 19, 2026
    Last edited: Sep 19, 2026
    sorry to jump in:

    1. The Root Cause
    Look at this line in Master.ps1:

    Code:
    powershell
    $script:ProjectRoot = [System.IO.Path]::GetFullPath((Join-Path $script:ScriptsDir "..\.."))
    Notice the prefix: $script: 
    Now look at this line in sub_Mount.ps1:

    Code:
    powershell
    $DiscoverIso = @(Get-ChildItem -LiteralPath $global:ProjectRoot -Filter "*.iso" -File)
    Notice the prefix: $global: 
    That's the bug. Master parked the car in the "Script" parking spot. sub_Mount is looking for it in the "Global" parking spot. Different lots


    2. Why Did It Only Blow Up Now?
    Because Master.ps1 has this at the very top:

    Code:
    powershell
    Set-StrictMode -Version Latest
    $ErrorActionPreference = 'Stop' 
    Set-StrictMode -Version Latest throws a terminating error the moment an undefined variable is read. So in a weird way, StrictMode saved you by stopped everything immediately and said "Hey, that variable doesn't exist." That's why you got a clear error message right away.

    Minimal fix:
    Code:
    Add 2 lines after root definition: $global:projectRoot = $script:projectRoot (plus ScriptsDir and DataDir) 
    Good lesson, I'm learning. Happy coding.

    Cheers
     
  2. sainfo

    sainfo MDL Addicted

    Dec 6, 2021
    760
    1,753
    30
    #2283 sainfo, Sep 19, 2026
    Last edited: Sep 19, 2026
    Thank you very much for your invaluable help in revising my script. Of course, I’ll take all your comments into account. The only thing I don’t understand is how this could be happening: I’ve run this script through many times and haven’t encountered any problems with it. But people are writing that they can’t get it to run. Using the tool itself requires minimal effort—it doesn’t get any easier than that—yet it doesn’t work for them. How can this be? Miracles don’t happen...

    To say that I’m learning this too would be an exaggeration. Because while .cmd is already second nature to me, when it comes to PowerShell, I’m still just taking my first steps. PowerShell is a really interesting topic for me, so I’m trying to get the hang of it. So far, it’s been a bit of a struggle—I guess the first pancake always comes out lumpy...
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. sainfo

    sainfo MDL Addicted

    Dec 6, 2021
    760
    1,753
    30
    #2284 sainfo, Sep 19, 2026
    Last edited: Sep 19, 2026
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. bendeyar

    bendeyar MDL Senior Member

    Mar 14, 2019
    276
    613
    10
  5. sainfo

    sainfo MDL Addicted

    Dec 6, 2021
    760
    1,753
    30
    Damn, you're just shocking me! So, in the DVD\sources folder, we get a .wim file, and in the .iso folder, the ISO file will be in .esd format.

    I'm currently testing a version of the tool with an extended menu that will allow you to choose whether or not to create an ISO image. I'll post it once I've finished testing it.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. bendeyar

    bendeyar MDL Senior Member

    Mar 14, 2019
    276
    613
    10
    You don't need to have both WIM and ESD files.
    This takes quite a long time, especially with ntlite.
    We look forward to the new version.
     
  7. sainfo

    sainfo MDL Addicted

    Dec 6, 2021
    760
    1,753
    30
    #2288 sainfo, Sep 19, 2026
    Last edited: Sep 21, 2026
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. bendeyar

    bendeyar MDL Senior Member

    Mar 14, 2019
    276
    613
    10
    There's no point in working with the ISO; it takes too long.
    It would be faster using just the install.wim file.
    That's just my opinion, though—it's up to you.
     
  9. sainfo

    sainfo MDL Addicted

    Dec 6, 2021
    760
    1,753
    30
    You might think it's pointless, but it's for experienced users. This tool is designed for a wider range of users, and that's why it works not only with install.wim but also with boot.wim, reducing its size by half. Furthermore, the user has the option of creating a DVD image for further editing with other programs, or, for inexperienced users, creating an ISO image in addition to the DVD. I don't think there's anything wrong with this for the end user. This tool wasn't created for any particular personal purpose, but for a wide range of users with varying levels of experience. In other words, this tool was created primarily with you, the average user, in mind.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. ODY123

    ODY123 MDL Expert

    Apr 20, 2011
    1,175
    193
    60

    Attached Files:

  11. ODY123

    ODY123 MDL Expert

    Apr 20, 2011
    1,175
    193
    60
    First pic is the optimized mounted ISO, second pic is the original mounted ISO. Thanks for all of your efforts!
     
  12. sainfo

    sainfo MDL Addicted

    Dec 6, 2021
    760
    1,753
    30
    #2293 sainfo, Sep 20, 2026
    Last edited: Sep 20, 2026
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  13. bendeyar

    bendeyar MDL Senior Member

    Mar 14, 2019
    276
    613
    10
    You’re right.
    Your script is for the average user,
    who wants everything to be ready to go and to create a modified operating system with a single click.
    I don’t think I’m one of them.
    I want to have the choice of what to keep and what to remove from the original operating system.
    That’s why I prefer SunLion’s script.
    I have nothing against your script.
    It’s good, and I hope it gets even better so more average users can benefit from it.

    Good luck with the project.
     
  14. sainfo

    sainfo MDL Addicted

    Dec 6, 2021
    760
    1,753
    30
    #2295 sainfo, Sep 20, 2026
    Last edited: Sep 20, 2026
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  15. bendeyar

    bendeyar MDL Senior Member

    Mar 14, 2019
    276
    613
    10
  16. sainfo

    sainfo MDL Addicted

    Dec 6, 2021
    760
    1,753
    30
    Hmm, that's weird, I don't even know what to tell you about this. I've tested the tool numerous times and haven't encountered any errors in the script, so it wasn't meant to be ...
    If anything, I can send you a screenshot of the walkthrough of this part of the scenario.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  17. jinggangshi

    jinggangshi MDL Novice

    Jun 29, 2023
    27
    19
    0
    If the original ISO is `zh-cn_windows_11_enterprise_ltsc_2024_x64_dvd_cff9cd2d.iso`, then
    `Language.Basic~~~zh-CN~0.0.1.0` cannot be removed.

    If you retain only English and Russian in WimOptimizer_25.11.5—thereby marking zh-CN as a redundant language to be stripped—and the original ISO is `zh-cn_windows_11_enterprise_ltsc_2024_x64_dvd_cff9cd2d.iso`, this error will occur.
     
  18. sainfo

    sainfo MDL Addicted

    Dec 6, 2021
    760
    1,753
    30
    #2300 sainfo, Sep 21, 2026
    Last edited: Sep 21, 2026
    I think I understand where this is coming from: the tool was created for myself, and so the script will remove all languages except English and Russian from the image. To fix this, you need to go to Data\Fils and remove or comment out the # language for your region in the CapabilityList.txt file.
    I somehow didn't think of this right away - thank you for this important note!
    I have added this information to my ad.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...