Slimdown10 – turn Windows 10 22H2 or LTSC 2021 into classic/legacy Windows

Discussion in 'Windows 10' started by Deleted member 190847, Feb 15, 2023.

  1. #61 Deleted member 190847, Feb 19, 2023
    Last edited by a moderator: Feb 19, 2023
    (OP)
    It is not mistake. REM commands are simply commented out commands and are intended to remove, because:
    1. After heavy testing, it turned out that they cause problems.
    - OR -
    2. I went too far, and these commands are not necessary for privacy nor debloating.

    Why I commented them out instead of removing them ?
    For possible further investigation, before deleting them permanently.


    You need to know that debloating Windows 10 is, contrary to appearances, hard work.
    You must be like a surgeon when doing it, ie. cut out the cancer but leave healthy tissue intact.
    That is what I am going to do.
    So some decisions are easy and obvious (ok, let's disable it) and other ones are hard and require a lot of testing and thinking.
    I do not want to create a caricature of operating system, I want to create slimmed down OS but still stable and properly working.

    Please, never use old versions.
    Current version is 1.10 and it includes DISM from Windows 10 ADK which is good enough to service Windows 10 22H2 images and (what is most important) it seems to work properly on Windows 7 SP1.
    The script cannot service 11 SKUs, because he counts them from 1 to 10 only (when you choose 0, you choose index 10). Maybe I should add another key (let's say A) for index 11.
    But relatively few people choose index number 11.
    So it is cosmetic bug to fix, but it is not critical issue.

    In my tests, the script completed with no errors. I have used Windows 7 SP1 ESU as a host and then Windows 10 22H2 as a host.
    And I have serviced many versions of Windows 10, but all of them were 22H2 of course.
     
  2. CaptainSpeleo

    CaptainSpeleo MDL Addicted

    May 24, 2020
    827
    499
    30
    I haven't played around much yet with Windows 10 Pro 22H2 64-bit after using Slimdown10-v1.10 to create an install disc, but I'm impressed about 3 things:
    The install process goes quick and eliminates several of the usual steps.
    All of the unneeded and useless bloatware that normally comes with it and takes a lot of time to get rid of is gone.
    Internet Explorer 11 works just like it does in Windows 7, and there's no Microsoft Edge to get in the way.

    There are a few things that I would've liked it to still have (Microsoft Store, Camera, etc.), but I can live with that.
    wkeller isn't going to be able to make EVERYONE happy about all that he's done with it, but I have to commend him for the job he's done.
    I'm sure he'll make some changes after receiving input from us.

    I'm off to a family dinner.
     
  3. #63 Deleted member 190847, Feb 20, 2023
    Last edited by a moderator: Feb 20, 2023
    (OP)
    Abstracting from the script itself.

    Here are my personal recommendations.

    1. Disable Search Indexing and Windows Search service entirely in Slimdown10.cmd.
    Code:
    :: - Disable search indexing. Search will still be fully functional, but with no index being built in the background.
    ::   It is recommended to disable it on systems installed on hard drives or other low resource computers.
      set DisableSearchIndexing=1
    
    :: - Disable Windows Search service entirely.
    ::   Windows Search on task bar will search now only applications, but no longer documents and files.
    ::   Search in Explorer will search files as usual, but those files will never be indexed.
    ::   It is recommended to disable it on systems installed on hard drives or other low resource computers.
      set DisableSearchService=1

    2. Hide Search Bar after installation.

    Hide_SearchBar.gif



    3. Replace Start Menu with Open Shell Menu and customize the latter to your preference.

    OpenShell_Menu.gif


    4. Have fun with smooth and convenient operating system :)
     
  4. Dude Guyman

    Dude Guyman MDL Senior Member

    Jun 20, 2017
    280
    279
    10
    I made an iso from the uup dump Enterprise version 19045.2006, then used slimdown10 on that and installed. So far it seems very good. The only oddity is I get the following error spammed in event viewer:
    "Failed to schedule Software Protection service for re-start at 2023-03-05T19:46:21Z. Error Code: 0x80070002."

    Anything I can tweak or configure to stop that?
     
  5. schubidubi

    schubidubi MDL Junior Member

    Nov 9, 2022
    78
    81
    0
    #66 schubidubi, Feb 20, 2023
    Last edited: Feb 20, 2023
    Thx, for the explanation. Now I see it more clear! I really appreciate that you invest so much time and effort for writing this nice Tool, and even more time for testing and optimizing your written code. :worthy:

    Yeah that would be really nice, if we could select which Apps got removed and options for WindowsDefender.

    wkeller, you may not want to change your script to accommodate a few random requests. But would it be possible to let the script search for uninstallable apps and let the user decide?

    And because WindowsDefender, I saw now in the script, that you only disable WindowsDefender and all Services belong to it, instead of removing as I assumed. Is it possible to reactivate WindowsDefender, after installation of the OS?

    I ask that, cause I would like to install the iso on different peoples computers. And some want the Defender and some don't, some want the Store and some don't. Maybe you could show me which parts in the script I have to change to accomplish this?

    Also would you like to tell me, how I get the February updates from Server 2008 or Embedded 7, integrated with the Integrate7 script? I think I must change the ESU components in the script, but don't know how... :confused:


    Greetings... ;)
     
  6. intruder16

    intruder16 MDL Novice

    Jul 17, 2014
    33
    19
    0
    Thanks for this script. I have been using a script I created similar to this for a couple of years. My script is very badly written but gets the job done for me. Haha.

    But since you have shared this wonderful script I was able to use modify it as per my personal use case (and Windows 11).

    I do have a suggestion regarding appx removal, I see that you are using below methods for removing appx:
    • Remove-ProvisionedAppxPackage command &
    • Delete apps folder using NSudo in \Windows\SystemApps\
    While it does get the job done, I have been using a different method I found here on MDL since a past few years (credits to @abbodi1406) and I have modified it to use with your script as below:

    Code:
    ECHO.
    ECHO ==============================================
    echo Removing user UWP apps...
    ECHO ==============================================
    ECHO.
    
    set "RemoveUserUWPapps=3DBuilder,InputApp,549981C3F5F10,Advertising,BioEnrollment,BingNews,BingWeather,GetHelp,Getstarted,Messaging,Microsoft3DViewer,MicrosoftEdge,MicrosoftOfficeHub,MicrosoftSolitaireCollection,MixedReality,MSPaint,OneConnect,OneNote,People,Photos,Print3D,SkypeApp,Todos,Wallet,WindowsAlarms,windowscommunicationsapps,WindowsFeedbackHub,WindowsMaps,WindowsSoundRecorder,YourPhone,ZuneMusic,ZuneVideo"
    
    for %%i in (%RemoveUserUWPapps%) do (
        call;
        for /f %%a in ('reg query "HKLM\TK_SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore" /s /f %%i /k 2^>nul') DO IF NOT ERRORLEVEL 1 (reg delete "%%a" /f >nul)
    )
    
    ECHO.
    ECHO ==============================================
    echo Removing system UWP apps...
    ECHO ==============================================
    ECHO.
    
    set "RemoveSystemUWPapps=Microsoft.AsyncTextService,Microsoft.BioEnrollment,Microsoft.ECApp,Microsoft.LockApp,Microsoft.MicrosoftEdge,Microsoft.MicrosoftEdgeDevToolsClient,Microsoft.Windows.AppRep.ChxApp,Microsoft.Windows.AssignedAccessLockApp,Microsoft.Windows.CallingShellApp,Microsoft.Windows.ContentDeliveryManager,microsoft.windows.narratorquickstart,Microsoft.Windows.OOBENetworkCaptivePortal,Microsoft.Windows.OOBENetworkConnectionFlow,Microsoft.Windows.PeopleExperienceHost,Microsoft.Windows.PinningConfirmationDialog,MicrosoftWindows.UndockedDevKit,NcsiUwpApp,Windows.CBSPreview"
    
    for %%i in (%RemoveSystemUWPapps%) do (
        call;
        for /f %%a in ('reg query "HKLM\TK_SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore" /s /f %%i /k 2^>nul') DO IF NOT ERRORLEVEL 1 (reg delete "%%a" /f >nul)
    )
    The above results in no appx deployment and does not touch any system files (I tend to avoid using NSudo & touch system files for any other stuff as well).
    One more benefit is the eaze of choosing which apps to remove (or to avoid deploy). :)
     
  7. intruder16

    intruder16 MDL Novice

    Jul 17, 2014
    33
    19
    0
    You can remove following section from the script:

    Code:
    ECHO.
    ECHO.
    ECHO =====================================================================================================
    ECHO Removing provisioned packages...
    ECHO =====================================================================================================
    ECHO.
    ECHO.
    
    for /f "tokens=2 delims=: " %%a in ('start "" /b "%DISM%" /English /Image:"%~dp0mount" /Get-ProvisionedAppxPackages ^| find "PackageName"') do (
     ECHO.
     ECHO.
     ECHO =====================================================================================================
     ECHO Removing provisioned package: %%a
     ECHO =====================================================================================================
     ECHO.
     "%DISM%" /English /Image:"%~dp0mount" /Remove-ProvisionedAppxPackage /PackageName:"%%a"
    )
    and replace the following section in the script with the code i provided in earlier post:

    Code:
    ECHO.
    ECHO ==============================================
    echo Removing system UWP apps...
    ECHO ==============================================
    ECHO.
    
    
    REM Remove unnecessary System UWP apps
    for %%u in (%RemoveSystemUWPapps%) do (
     for /f "tokens=1 delims=" %%a in ('dir /b /ad "%~dp0mount\Windows\SystemApps" 2^>nul ^| find /i "%%u"') do (
        ECHO Removing %%a
        "%~dp0tools\%HostArchitecture%\NSudo.exe" -U:T -P:E -UseCurrentConsole -Wait cmd /c "rd /s /q "%~dp0mount\Windows\SystemApps\%%a""
      )
    )
    You can try enabling DoSvc (Delievry optimization service) and check if minitool works. I had this problem before. I think this solved it.
     
  8. schubidubi

    schubidubi MDL Junior Member

    Nov 9, 2022
    78
    81
    0
    #70 schubidubi, Feb 21, 2023
    Last edited: Feb 21, 2023
    Thx, for helpin! :thumbsup:

    Edit:
    Whats about these lines (539-541 & 564-605)? Cause they are also related and i want to keep VCLibs. Should I remove them, too?
    Code:
    (539-541)
    ::  By default remove all system UWP apps unless they are really necessary
    ::  Can be changed to minimal version  set "RemoveSystemUWPapps=Microsoft.MicrosoftEdge,Microsoft.MicrosoftEdgeDevToolsClient,Microsoft.Windows.ContentDeliveryManager"
    set "RemoveSystemUWPapps=Microsoft.AccountsControl,Microsoft.AsyncTextService,Microsoft.BioEnrollment,microsoft.creddialoghost,Microsoft.ECApp,Microsoft.LockApp,Microsoft.MicrosoftEdge,Microsoft.MicrosoftEdgeDevToolsClient,Microsoft.Windows.AddSuggestedFoldersToLibraryDialog,Microsoft.Windows.AppRep.ChxApp,Microsoft.Windows.AppResolverUX,Microsoft.Windows.AssignedAccessLockApp,Microsoft.Windows.CallingShellApp,Microsoft.Windows.CapturePicker,Microsoft.Windows.ContentDeliveryManager,microsoft.windows.narratorquickstart,Microsoft.Windows.OOBENetworkCaptivePortal,Microsoft.Windows.OOBENetworkConnectionFlow,Microsoft.Windows.PeopleExperienceHost,Microsoft.Windows.PinningConfirmationDialog,Microsoft.Windows.SecureAssessmentBrowser,Microsoft.XboxGameCallableUI,MicrosoftWindows.Client.CBS,MicrosoftWindows.UndockedDevKit,NcsiUwpApp,ParentalControls,Windows.CBSPreview"
    
    and
    
    (564-605)
    REM This section is for compatibility with Windows 7/8/8.1
    if "%InternalDISM%"=="0" goto skipREGprov
    for /f "tokens=1 delims=" %%a in ('dir /on /b "%~dp0mount\Program Files\WindowsApps\Microsoft.*" 2^>nul') do (
     ECHO.
     ECHO.
     ECHO =====================================================================================================
     ECHO Removing provisioned package: %%a
     ECHO =====================================================================================================
     ECHO.
     echo %%a | findstr /r /i /c:"Microsoft\.VCLibs\.[0-9]*\.[0-9]*_" >nul 2>&1
     if ERRORLEVEL 1 (
      "%~dp0tools\%HostArchitecture%\NSudo.exe" -U:T -P:E -UseCurrentConsole -Wait cmd /c "rd /s /q "%~dp0mount\Program Files\WindowsApps\%%a""
     )
    )
    
    REM Clear the registry keys too
    for /f "tokens=9 delims=\" %%a in ('reg query "HKLM\TK_SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Applications" /k /f "Microsoft." 2^>nul ^| find /i "\Applications\Microsoft."') do (
     ECHO.
     ECHO.
     ECHO =====================================================================================================
     ECHO Removing provisioned package: %%a
     ECHO =====================================================================================================
     ECHO.
     echo %%a | findstr /r /i /c:"Microsoft\.VCLibs\.[0-9]*\.[0-9]*_" >nul 2>&1
     if ERRORLEVEL 1 (
      reg delete "HKLM\TK_SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Applications\%%a" /f >nul 2>&1
     )
     for /f "tokens=1,4,5 delims=_" %%b in ('echo %%a') do (
      if "%%d"=="" (
       reg add "HKLM\TK_SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Deprovisioned\%%b_%%c" /f >nul
       reg delete "HKLM\TK_SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Deprovisioned\%%b_%%c" /ve /f >nul 2>&1
       reg delete "HKLM\TK_SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Staged\%%b_%%c" /f >nul 2>&1
       reg delete "HKLM\TK_SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Config\%%b_%%c" /f >nul 2>&1
      )
      if not "%%d"=="" (
       reg add "HKLM\TK_SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Deprovisioned\%%b_%%d" /f >nul
       reg delete "HKLM\TK_SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Deprovisioned\%%b_%%d" /ve /f >nul 2>&1
       reg delete "HKLM\TK_SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Staged\%%b_%%d" /f >nul 2>&1
       reg delete "HKLM\TK_SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Config\%%b_%%d" /f >nul 2>&1
      )
     )
    )


    More Problems..., can't activate DoSvc...
    moreProbs.PNG


    It gets even more crazy, WindowsUpdate showed me 2 Updates one from Feb'23 kb 5022834 Cumulative (which was already installed) and one from Jan'23, I don't remember the KB Number. It installed both (sadly, i had no choice to unselect the Jan'23 one), but they don't show up as installed in the Update overview. kb5022834 is there, but with install dated to yesterday, when i installed the OS!
    Overview.PNG

    After that update it showed me a new App in Programs, called Microsoft Update Health Tools (which I instantly uninstalled). Installation date was today! What happened there? Does M$ know, after connect to update servers, that I run a modified Win10 Home and gave me a sneaky update? :sneaky:...:sniper: :orb:


    I'm much confused now.

    Greetings... :confused:

    (Edited some of the Text and some of the code)
     
  9. #71 Deleted member 190847, Feb 21, 2023
    Last edited by a moderator: Mar 2, 2023
    (OP)
    First of all, I'd like to thank you for your suggestions, comments and bug reports.
    And please understand that I don't always have time to deal with this immediately due to work and other obligations
    But I remember everything and will deal with it when time (and my energy) allows.

    However, I will answer some things right away.

    Sorry, I disagree that your different method is better.

    There are two sections of APPX removal.
    1. User APPX packages removal
    2. System APPX packages removal.

    In the first case, I use DISM to remove APPX packages which is safest method possible, because it is simply official Microsoft’s method.

    Your method has two drawbacks.
    1. It is not complete “Why to leave APPX packages and remove only registry entries ?”.
    It is leaving some remnants and I do not think that it is generally good approach.
    2. It doesn’t add APPX to Deprovisioned registry key, whose goal is (according to Microsoft) to prevent reinstalling of these apps via feature updates.

    And yes, my script also contains manual (non-DISM) method of removing user APPX packages, but this method is only provided for compatibility with older systems (Windows 7/8.1) and is rather not used on Windows 10.
    The method however, was designed to recreate 1:1 original Microsoft DISM method.

    In the second case (ie. System APPX) packages, there is no preferred method, because removing System APPX packages is not documented by Microsoft and is always considered as ugly hack.
    So you cannot say for sure, that your method is good and my is bad, because all are considered as such hacks.
    But I do prefer my method because it is cleaner. And I do not see a reason why to leave some leftovers.

    It is of course a risk, that some feature update will reinstall System APPX packages back. But I do not recommend installing feature updates on such modded Windows 10 version at all.
    That is a reason, why I have disabled them in another part of the script.
    So Windows Update will no longer provide you feature updates for Windows 10 and no longer will propose you Windows 11 upgrade either.

    If you have any tiles in Start Menu, the answer is one. The script has failed and your ISO image has been created improperly.
    And such improperly created ISO image is worthless, sorry.

    You are confusing Windows 10 with Windows 7.
    In Windows 10, the Update Orchestrator (UsoSvc) is responsible for Windows Update working properly, not the Windows Update (wuauserv) service.
    And the first one could be enabled/disabled with my Toggle Windows Update tool which is already included by default.

    PS. You should not disable the Windows Update (wuauserv) service at all, because it will block you from installing MSU updates even manually,

    EDIT: Windows Defender availability is now switchable in version 1.20.
    System APPX packages are now removed only from the registry in the above version, but it can be switched via setting to remove them also from disk.
     
  10. CaptainSpeleo

    CaptainSpeleo MDL Addicted

    May 24, 2020
    827
    499
    30
    The slimmed down version is 99% okay to me, so you probably will not get any complaints from me. :)
     
  11. schubidubi

    schubidubi MDL Junior Member

    Nov 9, 2022
    78
    81
    0
    Sure, no problem. I totaly understand! It's nice that you share your experiences and help... :hug:


    I make a new ISO now. Is this one Ok to work with? "en-us_windows_10_consumer_editions_version_22h2_x64_dvd_8da72ab3.iso"

    Only thing i have changed now in your script is the search options in the beginning section and this:
    Code:
    :: Disable these permisions for system UWP apps
    :: eg. if you want to prevent system UWP apps from accessing cellular data, WiFi data, microphone and camera
    :: replace the following line with   set DisableSysUWPpermissions=cellularData,wifiData,microphone,webcam
    set DisableSysUWPpermissions=cellularData,wifiData,microphone,webcam
    Is that Ok or should i leave it default?
     
  12. #74 Deleted member 190847, Feb 22, 2023
    Last edited by a moderator: Feb 22, 2023
    (OP)
    It should be. However, if you have any doubts you can use the link provided by Enthousiast.
    The link contains wrapper script which will redirect you directly to Microsoft, so you will download 100% valid genuine ISO.

    But is not just about ISO, it is also important (or maybe even more important) your host OS which you use to build ISO images.
    Microsoft DISM tool which is used in the lion's part of my script is unfortunately not rock solid, despite being developed by Microsoft.
    I would say that it is rather fragile.
    It can fail with unpredictable errors if your computer is low on resources (eg. memory or disk space) or if you have some security software or antivirus.

    I have tested my script on Windows 7 SP1 (updated ESU Jan 2023 edition) and on Windows 10 22H2 (on both: original/unmodded and my modded version), but I cannot test it in every possible environment on every user's PC.

    It should be ok, however not well tested yet.
    You should remember that such things like Start Menu or Settings are also system UWP apps.
    So if access to your microphone, camera, etc. would be blocked somewhere where it shouldn't be, you will know where is the culprit.
     
  13. intruder16

    intruder16 MDL Novice

    Jul 17, 2014
    33
    19
    0
    I was just providing an alternative suggestion. I see a lot of similar slimming tools/scripts that does not use what i suggested so I always thought it's possible people are not aware of it. Hence my 2 cents.

    Ofcourse everyone has different opinions and opinions can't be wrong. IMHO disabling is always better than deleting stuff be it files, folders, services, tasks etc. A few dormant files/folders never hurt. With the way Windows has linked features together in recent years, if there's a new update, there is always a chance of breaking something due to some tweak that seemed harmless before. But anyway, enough with me bragging, we have different opinions and I respect yours. :)
     
  14. ricoutine

    ricoutine MDL Novice

    Jan 31, 2021
    7
    0
    0
    Hi and thanks for your work. I wanted to test it so I just created a pro version, but when I want to install it over my existing LTSC asks for a key product. How to do it ?
     
  15. Simply choose "I do not have a product key" and go on.
    It will be activated later using your online digital license (if you have such) or you can use KMS_VL_ALL.
     
  16. ricoutine

    ricoutine MDL Novice

    Jan 31, 2021
    7
    0
    0
    Thank you very much, didn't seen this option, sorry for that. During this time I wondered if it would be better for me to try the "Education" version rather than the "Pro". Closer to LTSC, right?
     
  17. When you consider original/unmodded version, you may be right.
    But modded version is so slimmed down that it doesn't make any difference.
    Choose Pro, it is very good.
     
  18. ricoutine

    ricoutine MDL Novice

    Jan 31, 2021
    7
    0
    0
    Ok, but, tried again ant I'm not seeing this option :
    "I do not have a product key"