Optimize-Offline Guide - Windows Debloating Tool, Windows 1803, 1903, 19H2, 1909, 20H1 and LTSC 2019

Discussion in 'Windows 10' started by KedarWolf, Jul 30, 2019.

  1. KedarWolf

    KedarWolf MDL Addicted

    Mar 17, 2016
    977
    870
    30
    Sometimes I disable things with Autoruns the script misses. Like a few services, OneDrive Entries, Wi-Fi and Bluetooth entries and offline file and encryption stuff I never use. You can Search, find those.
     
  2. rentay

    rentay MDL Junior Member

    Dec 30, 2013
    88
    17
    0
    Thanks :)

    So still a good idea to run Set-Additional.cmd (or ps1) for the tweaks it provides even if it doesn’t do anything for Services/Scheduled tasks

    I can just go through services.json and scheduled tasks.json and use Autoruns to disable what’s in those lists :)
     
  3. KedarWolf

    KedarWolf MDL Addicted

    Mar 17, 2016
    977
    870
    30
    Yes.
     
  4. rentay

    rentay MDL Junior Member

    Dec 30, 2013
    88
    17
    0
    Thanks for all your help :D

    It’s certainly a slippery slope using all the features OO has to offer lol

    Is it a known bug that the script can’t disable services and/or scheduled tasks via set-additional.cmd?
     
  5. Mavericks Choice

    Mavericks Choice MDL Guru

    Aug 5, 2015
    2,885
    12,377
    90
    I always make small changes & test in a VM to ensure all works without breakages.
     
  6. Assasin13

    Assasin13 MDL Novice

    Aug 14, 2016
    23
    2
    0
    Latest LTSC latest release from gdelina:

    I tried twice. Any ideas?
     
  7. rentay

    rentay MDL Junior Member

    Dec 30, 2013
    88
    17
    0
    Having a small problem with disabling of services via the Optimize script.

    If I manually disable the services in Windows everything is fine however if I use the script to disable the services, it breaks the System settings (cannot change display settings).

    Here is the list of services I am disabling. Have gone through the list and applied these separately via the script as either ServicesList.json or AdvancedServices.json

    Has anyone encountered the same problem? I'm using Windows 10 LTSC 2021

    Code:
    {
       "__Info": [
           "Insert the services display names as a list, the names are found in the ./ServicesTemplate.json in the 'name' key"
       ],
       "Services": [
           "AJRouter",
            "ALG",
            "BcastDVRUserService",
            "bthserv",
           "CDPSvc",
            "CertPropSvc",
            "CscService",
            "diagnosticshub.standardcollector.service",
            "diagsvc",
            "DiagTrack",
            "dmwappushservice",
            "DoSvc",
            "DusmSvc",
            "FrameServer",
            "Fax",
            "FrameServer",
            "HvHost",
            "icssvc",
            "MapsBroker",
            "MSiSCSI",
            "NcbService",
            "PcaSvc",
            "PeerDistSvc",
            "PhoneSvc",
            "RetailDemo",
            "RpcLocator",
            "SCardSvr",
            "ScDeviceEnum",
            "SCPolicySvc",
            "SEMgrSvc",
            "SensorDataService",
            "SensorService",
            "SensrSvc",
            "SessionENV",
            "SmsRouter",
            "stisvc",
            "SysMain",
            "TabletInputService",
            "TermService",
            "tzautoupdate",
            "UmRdpService",
            "vmicguestinterface",
            "vmicheartbeat",
            "vmickvpexchange",
            "vmicrdv",
            "vmicshutdown",
            "vmictimesync",
            "vmicvmsession",
            "vmicvss",
            "WalletService",
            "Wecsvc",
            "wercplsupport",
            "WerSvc",
            "WinRM",
            "wisvc",
            "WMPNetworkSvc",
            "WpcMonSvc",
            "WPDBusEnum",
            "WwanSvc"
       ]
    }
    
     
  8. gdeliana

    gdeliana MDL Senior Member

    Oct 2, 2010
    363
    410
    10
    May i ask you what is your host OS? if host is W11 then for sure this is a problem with DISM.exe of the host refusing to remove that package. Maybe use W10 as host? But for sure that error comes from DISM.exe and is not under the competences of the script actually.
     
  9. gdeliana

    gdeliana MDL Senior Member

    Oct 2, 2010
    363
    410
    10
    Some services refuse to get disabled before setup in an offline image and then in online env they can be disabled without problem. Also known issue.
    Basically it's the registry key ownership that makes it impossible to modify. Will take a look if this can be forced somehow without breaking windows installation.
     
  10. Assasin13

    Assasin13 MDL Novice

    Aug 14, 2016
    23
    2
    0
    #1670 Assasin13, Jan 8, 2022
    Last edited: Jan 8, 2022
    Hi gdeliana,

    I am using a windows 10 enterprise release to create this image. If it is a dism problem any idea why it does not appear in a previous package? I will try without removing the fax application

    Edit without fax application the procedure works
     
  11. rentay

    rentay MDL Junior Member

    Dec 30, 2013
    88
    17
    0
    When I run the Set-Additional.ps1 post install, the script is not disabling any of the services that I have amended in the Services.json file

    Is there some other way to make these run besides manually disabling each service?
     
  12. strotee

    strotee MDL Member

    Jan 30, 2011
    228
    204
    10
    You could change it in the registry, reboot and it'll be Disabled. I occasionally do this for those pesky services that just don't want to budge.
    Code:
    for %%d in (TabletInputService,Registry_name_example) do (
      reg add "HKLM\SYSTEM\CurrentControlSet\Services\%%d" /v "Start" /t REG_DWORD /d "4" /f >NUL 2>&1
    )
    
    Of course, copy/paste and change the registry names with the services that you want to modify. Save as .bat or .cmd and Run as Admin.
     
  13. rentay

    rentay MDL Junior Member

    Dec 30, 2013
    88
    17
    0
    #1673 rentay, Jan 10, 2022
    Last edited: Jan 10, 2022
    Thanks :D will definitely have to give this a try
    I have around 54 services that I want disabled so will take some time to compile the list. It's such a shame the script GodHand made doesn't work :(

    Just wanted to make sure as I am very new to all of this, the service name is in the brackets '(TabletInputService,Registry_name_example)'?

    Edit: just got it working, thanks for the script!
    Now the big task of including all my services I want disabled :D
     
  14. KedarWolf

    KedarWolf MDL Addicted

    Mar 17, 2016
    977
    870
    30
    You can run the populateTemplates.bat and it'll populate the Advanced Services list will ALL the services your ISO has.
     
  15. gdeliana

    gdeliana MDL Senior Member

    Oct 2, 2010
    363
    410
    10
    It may be because the fax feature is locked for removal by the host DISM. What do you mean with "previous package"? A previous version of the OO script? If so i will take a look, but don't remember touching any code related to fax feature removal, nor there is any specific code for that in the script. The script considers that feature just as all the other features, nothing special for the fax :confused:
     
  16. gdeliana

    gdeliana MDL Senior Member

    Oct 2, 2010
    363
    410
    10
    Just to be specific: the script way how it gets WIM services is by reading the registry keys of:

    Code:
    HKLM\SYSTEM\CurrentControlSet\Services
    In this folder there do exist not only windows services found in the services.msc interface, but as well WINDOWS DRIVERS and as well other windows features. Unfortunatelly there is no straight forward way to filter the list to show just the windows services. So one must be careful and really know in advance which are the real windows services. Touching and modifying the other keys may lead to non bootable windows image.
     
  17. gdeliana

    gdeliana MDL Senior Member

    Oct 2, 2010
    363
    410
    10
    This is really strange, for me the script works after the initial windows setup. This script has been only slightly modified by me, but haven't touched the services removal part. So as it was in the main repository, it's even in the fork. Try to grab some console output when you run the script. Maybe there is some error.
     
  18. rentay

    rentay MDL Junior Member

    Dec 30, 2013
    88
    17
    0
    When I incorporate the services I want disabled at the time of iso creation, the output log shows the services are disabled however when I boot first time in to Windows I loose the ability to access 'Display settings'

    Just finished creating the .bat script as per Strotee's recommendation and it works great. Have modified 'Set-Additional.ps1' to only include disabling Scheduled Tasks and everything is working as it should :D
     
  19. gdeliana

    gdeliana MDL Senior Member

    Oct 2, 2010
    363
    410
    10
    Ah ok that is normal if you disable services that make windows functionalities break. That's why i said here before, OO script is a tool that helps you modify windows, but its not the brain behind everything, you need to still drive the car :)
     
  20. rentay

    rentay MDL Junior Member

    Dec 30, 2013
    88
    17
    0
    :D that is true
    What is weird though is the services I was disabling during the iso creation, I did a clean Optimized iso without integrating disabling those services and once windows was installed manually disabled all 56 and everything was fine
    Must be a service or two that when disabled whilst iso creation breaks something with display properties