Win10 LTSB N service tweaking

Discussion in 'Windows 10' started by radelrama, Aug 27, 2015.

  1. radelrama

    radelrama MDL Novice

    Aug 10, 2015
    8
    8
    0
    #1 radelrama, Aug 27, 2015
    Last edited: Aug 27, 2015
    I'm using Windows since V2.0, this version finally introduces triggered service start.

    Even though I tried to have most services on MANUAL and STOPPED, my config is extreme and disables some services. Windows runs flawlessly with around 26 processes, I use batch files to enable firewalling or updating.

    - Disabled firewall, updates, homegroup, computer browser, secondary logon, remote, etc
    - StartIsBack++ hinders SearchUI.exe/ShellExperienceHost.exe (could be done also by renaming)
    - Renaming system files to stop Tile and TimeBroker services and using GroupPolicy to reset on shutdown for correct startup

    Win10 LTSB N running with 26 processes, net start gives
    Background Tasks Infrastructure Service
    CoreMessaging
    Cryptographic Services
    DCOM Server Process Launcher
    Device Setup Manager
    DNS Client
    Group Policy Client
    Local Session Manager
    Network Store Interface Service
    Plug and Play
    Power
    Remote Procedure Call (RPC)
    RPC Endpoint Mapper
    Security Accounts Manager
    Server
    System Events Broker
    Task Scheduler
    TCP/IP NetBIOS Helper
    User Profile Service
    Windows Audio
    Windows Audio Endpoint Builder
    Windows Driver Foundation - User-mode Driver Framework
    Windows Font Cache Service
    Windows Management Instrumentation
    WMI Performance Adapter
    Workstation

    Serviceblock1.bat:
    rem disable tracking and info gathering
    sc config DiagTrack start= disabled
    sc config diagnosticshub.standardcollector.service start= disabled
    sc config dmwappushservice start= disabled
    sc config RemoteRegistry start= disabled
    sc config TrkWks start= disabled
    sc config WMPNetworkSvc start= disabled
    sc config WSearch start= disabled
    rem disable Windows Search, Windows Update, CertProp DiagTracking DistLinkTracking dmwappushsvc ShellHard Sspd WinHttp
    sc config CertPropSvc start= disabled
    sc config MSDTC start= disabled
    sc config SSDPSRV start= disabled
    sc config WinHttpAutoProxySvc start= disabled
    REM Shell Hardware Detection, no CD/DVD autostart!
    sc config ShellHWDetection start= disabled

    ServiceBlock2.bat
    rem disable HomegroupProvider ComputerBrowser Dhcp NetworkBroker NetworkAwareness WindowsConnect WindowsFirewall
    rem manual Backgroundintelligent EventLog Secondarylogon SystemEventsNotification Windowserror Windowsconnectionmanager
    sc config HomeGroupProvider start= disabled
    sc config Browser start= disabled
    sc config Dhcp start= disabled
    sc config NcbService start= disabled
    sc config NlaSvc start= disabled
    sc config wcncsvc start= disabled
    sc config MpsSvc start= disabled
    sc config BITS start= demand
    sc config EventLog start= demand
    sc config seclogon start= demand
    sc config SENS start= demand
    sc config WerSvc start= demand
    sc config Wcmsvc start= demand

    Image of system in that state, Startup.bat (startup script executed ONCE after imaging):
    sc config WerSvc start= disabled >NUL
    net stop WerSvc >NUL
    sc config wscsvc start= disabled >NUL
    net stop wscsvc >NUL
    sc config eventlog start= disabled >NUL
    net stop eventlog >NUL
    sc config Themes start= disabled >NUL
    net stop Themes >NUL

    StopServices.bat (startup script on every reboot):
    net stop "Device Setup Manager" >NUL
    net stop "Diagnostic Service Host" >NUL
    net stop "Diagnostic Policy Service" >NUL
    net stop "IKE and AuthIP IPsec Keying Modules" >NUL
    net stop "IPsec Policy Agent" >NUL
    net stop "User Manager" >NUL
    net stop "Device Association Service" >NUL
    net stop "COM+ System Application" >NUL
    net stop BFE >NUL
    net stop sens >NUL
    net stop "Windows Image Acquisition (WIA)" >NUL
    net stop "Windows Installer" >NUL
    net stop "Update Orchestrator Service" >NUL
    net stop "Secondary Logon" >NUL
    net stop "Human Interface Device Service" >NUL
    net stop "COM+ Event System" >NUL
    net stop "Windows Error Reporting Service" >NUL
    net stop "Distributed Transaction Coordinator" >NUL
    REM disable Eventlog !
    sc config Eventlog start= disabled >NUL
    net stop eventlog
    REM disable Tile service
    takeown /f c:\windows\system32\tileobjserver.dll
    icacls c:\windows\system32\tileobjserver.dll /grant administrators:f
    net stop tiledatamodelsvc >NUL
    move c:\windows\system32\tileobjserver.dll c:\windows\system32\tileobjserver.org.dll >NUL
    REM disable TimeBroker service
    takeown /f c:\windows\system32\TimeBrokerServer.dll
    icacls c:\windows\system32\TimeBrokerServer.dll /grant administrators:f
    net stop TimeBroker >NUL
    move c:\windows\system32\TimeBrokerServer.dll c:\windows\system32\TimeBrokerServer.org.dll >NUL

    Cleanup.bat (to be used in Windows session, stop services that might have been started):
    net stop DsmSvc & net stop DeviceAssociationService & net stop WdiServiceHost & net stop DPS & net stop IKEEXT & net stop PolicyAgent & net stop UserManager & net stop SecLogon & net stop SENS & net stop hidserv & net stop eventsystem & net stop dssvc & net stop stisvc & net stop KeyIso & net stop BFE

    GrouPolicy ShutdownScript.bat (for Tile/TimeBroker to start and prevent delays):
    @MOVE c:\windows\system32\tileobjserver.org.dll c:\windows\system32\tileobjserver.dll
    @MOVE c:\windows\system32\TimeBrokerServer.org.dll c:\windows\system32\TimeBrokerServer.dll

    WfwON.bat (WindowsFirewall):
    sc config MpsSvc start= demand
    net start MpsSvc

    WfwOFF.bat:
    net stop "IKE and AuthIP IPsec Keying Modules"
    net stop "IPsec Policy Agent"
    net stop MpsSvc
    net stop BFE
    sc config MpsSvc start= disabled
    sc config BFE start= demand

    WuON.bat (WindowsUpdate):
    sc config wuauserv start= demand
    sc config fdPHost start= demand
    sc config HomeGroupProvider start= demand
    sc config NlaSvc start= demand
    sc config Dhcp start= demand

    WuOFF.bat:
    net stop wuauserv
    net stop HomeGroupProvider
    net stop NcdAutoSetup
    net stop netprofm
    net stop NlaSvc
    net stop Dhcp
    sc config wuauserv start= disabled
    sc config fdPHost start= disabled
    sc config HomeGroupProvider start= disabled
    sc config NlaSvc start= disabled
    sc config Dhcp start= disabled
     
  2. detroit

    detroit MDL Junior Member

    Oct 31, 2013
    73
    10
    0
    i like your way of working mate, optimised system running only essential proccessors.
    Any more details you can share about useage of these scripts? How to use, where to place etc?
     
  3. radelrama

    radelrama MDL Novice

    Aug 10, 2015
    8
    8
    0
    #3 radelrama, Aug 29, 2015
    Last edited: Aug 29, 2015
    (OP)
    I use them like that in Win10
    - IMAGE1 Install OS, activate
    - IMAGE2 Settings OS, portable/non-install utils, ServiceBlock1.bat
    - IMAGE3 Chipset and all other drivers but sound/vga, essential programs, ServiceBlock2.bat
    - IMAGE4 Install Sound/vga suites
    - IMAGE5 Win10Update, ready to use, Startup.bat

    So my startup script executes for the first time after x hours of install... Only ServiceBlock1/ServiceBlock2 were done nothing more. Good stable base is important!

    A shortcut of STARTUP.BAT in the Startup folder of StartMenu executes it on every login
    - checks for first startup (in my case a check for Java installation) and if so ONCE block is executed
    - rest is executed on every login

    Very very simplified something like:

    @echo off
    cls
    echo.
    reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" | findstr BuildLabEx
    echo.
    echo.

    REM EVERY REBOOT
    regedit /s c:\windows\command\4\RemoveFoldersThisPC.reg
    regedit /s c:\windows\command\4\Photoviewer_Extensions.reg
    call c:\windows\command\4\RenameTile.bat
    call c:\windows\command\4\RenameTimeBroker.bat
    call c:\windows\command\4\RenameOpenCL.bat
    rem call c:\windows\command\4\RenameSearchUI.bat
    call c:\windows\command\4\RenameShellExperienceHost.bat
    if exist "c:\program files\java\jre7\bin\javaw.exe" goto end

    REM ONCE
    sc config WerSvc start= disabled >NUL
    net stop WerSvc >NUL
    sc config wscsvc start= disabled >NUL
    net stop wscsvc >NUL
    sc config eventlog start= disabled >NUL
    net stop eventlog >NUL
    sc config Themes start= disabled >NUL
    net stop Themes >NUL
    cls
    echo.
    echo Installing Adobe Flash Player...
    call \\srv\d$\pub\ftproot\pub\win\.TcpIp\Adobe\UpdateFlash.bat
    echo.
    echo Installing Java...
    start /wait \\srv\d$\pub\ftproot\pub\win\.TcpIp\Java\jre-7u80-windows-x64.exe /s SPONSORS=0
    rmdir /S /Q "c:\ProgramData\Microsoft\Windows\Start Menu\Programs\Java"
    echo.

    :end






    Maybe just one more word to the tweaks of first post:
    - not a copy'n'paste'n'run thing, it's just an example, every install differs..
    - careful with renaming system files, this might e.g. on a BSOD leave the system in a very "angry" state :)
    It's good to have the renaming undone when updating windows or checking component store, like

    DismChk.bat:
    @ECHO OFF
    Dism.exe /online /cleanup-image /scanhealth
    echo.
    echo.
    Dism /Online /Cleanup-Image /AnalyzeComponentStore
    echo.
    echo.
    pause
    cls
    echo.
    if exist c:\windows\system32\tileobjserver.dll goto scanit
    echo For complete check, tweaks must be undone!
    pause
    call c:\windows\command\DismTweak.bat
    cls
    echo.
    echo About to start SFC /SCANNOW
    pause
    SFC /SCANNOW
    echo.
    echo.
    echo Last step, redo Rename tweaks
    pause
    if exist c:\windows\system32\tileobjserver.dll call c:\windows\command\DismTweak.bat
    goto end

    :scanit
    cls
    echo.
    echo About to start SFC /SCANNOW
    pause
    SFC /SCANNOW
    echo.
    echo.
    pause
    :end
     
  4. revertex

    revertex MDL Member

    May 30, 2010
    119
    46
    10
    Thanks, You buy me some serious time here providing a nice starting point.

    Some things should be noted that you didn't mention, these settings are not to be taken lightly.

    These are serious tweaks that will improve performance and responsiveness in a range from a bit to a LOT, depending of your hardware and type of software you use.

    As an example, people that use to edit audio, surely will benefit a lot from these settings, gamers may have a few extra FPS in low end machines.

    Disabling DHCP service means that you will need to setup your IP address manually.

    Disabling server means that you cannot share folders in your network, disabling computer browser you will not find any computer share in your network, unless setup manually.

    Please double check before apply these settings and start screaming fire!
     
  5. radelrama

    radelrama MDL Novice

    Aug 10, 2015
    8
    8
    0
    Startup is ok but Logoff/Logon will delay, therefore instead of Shutdown define a Logoff script:

    GrouPolicy LogOff.bat (for Tile/TimeBroker to start, prevent delays startup and login):
    @MOVE c:\windows\system32\tileobjserver.org.dll c:\windows\system32\tileobjserver.dll
    @MOVE c:\windows\system32\TimeBrokerServer.org.dll c:\windows\system32\TimeBrokerServer.dll
    @net start tiledatamodelsvc >NUL
     
  6. AnimaliX

    AnimaliX MDL Novice

    Jul 28, 2009
    45
    23
    0
    #6 AnimaliX, Aug 30, 2015
    Last edited: Aug 31, 2015
    i disabling TimeBroker from registry "HKLM\SYSTEM\CurrentControlSet\Services\TimeBroker" without any difference on startup time... i think :)

    but disabling/enabling Tile Data service every time when you shutdown/startup PC is crazy... :) that service have no such impact on system and memory
    i know if you not using "new" startmenu or when you rename ShellExperienceHost.exe then that service is no needed anymore, but still... create so much effort only for one tiny service is little overdo

    maybe if we can find a way to get it disabled permanently without side effects
     
  7. radelrama

    radelrama MDL Novice

    Aug 10, 2015
    8
    8
    0
    #7 radelrama, Sep 3, 2015
    Last edited: Oct 6, 2015
    (OP)
    You're right, I'm not using the built-in thing to start, StartIsBack++ does a great job and btw reduces time to startup (place a Notepad.lnk in Startup, 2secs to Notepad, orig Win10 10secs to Notepad).

    But my tweaks go further.
    - I don't use UWP apps
    - I'd like to disable "SecurityCenter" service without Notification that can't be switched off

    Found a way to disable UWP apps, WITHOUT loosing the possibility to start them; and NO Notification if SecurityCenter not running, finally!!

    Again some system files have to be renamed and a executable autoit-script replaces AppFrameHost.exe to start the necessary services/processes to enable UWPapps, Settings and orig Startmenu. All this might be a overkill for some, others might find that useful...

    Renames to switch off UWP completely (don't forget to include that in Logoff script also):
    takeown /f c:\windows\system32\ApplicationFrameHost.exe >NUL
    icacls c:\windows\system32\ApplicationFrameHost.exe /grant administrators:f >NUL
    taskkill /F /IM ApplicationFrameHost.exe >NUL
    move c:\windows\system32\ApplicationFrameHost.exe c:\windows\system32\ApplicationFrameHost.org.exe >NUL
    move c:\windows\system32\ApplicationFrameHost.au3.exe c:\windows\system32\ApplicationFrameHost.exe >NUL
    takeown /f c:\Windows\ImmersiveControlPanel\SystemSettings.exe >NUL
    icacls c:\Windows\ImmersiveControlPanel\SystemSettings.exe /grant administrators:f >NUL
    taskkill /F /IM SystemSettings.exe >NUL
    move c:\Windows\ImmersiveControlPanel\SystemSettings.exe c:\Windows\ImmersiveControlPanel\SystemSettings.org.exe >NUL

    ApplicationFrameHost.au3 (convert with Aut2Exe 64bit to Windows\system\ApplicationFrameHost.exe):
    Opt("TrayIconHide", 1)
    Global $tmp, $i
    If FileExists( "c:\windows\system32\ApplicationFrameHost.au3.exe" ) Then
    Exit
    EndIf
    Run( "c:\windows\command\autoit3_x64.exe c:\windows\command\UWPToggle.au3", "", @SW_HIDE )

    UWPToggle.au3:
    Opt("TrayIconHide", 1)
    RunWait( @ComSpec & " /c " & "taskkill /F /IM ApplicationFrameHost.exe", "", @SW_HIDE )
    If FileExists( "c:\windows\system32\ApplicationFrameHost.org.exe" ) Then
    RunWait( @ComSpec & " /c " & "RenameON.bat", "", @SW_HIDE )
    Beep (1000,250 )
    Beep (1500,250 )
    RunWait( @ComSpec & " /c " & "net start TimeBroker & net start tiledatamodelsvc & sleep 500 & start c:\windows\system32\ApplicationFrameHost.exe", "", @SW_HIDE )
    FileCopy( "c:\Users\YourUsername\AppData\Roaming\Microsoft\Windows\Start Menu\...\UWPToggle.lnk", "c:\Users\YourUsername\Desktop" )
    Else
    FileDelete( "c:\Users\YourUsername\Desktop\UWPToggle.lnk" )
    Run( @ComSpec & " /c " & "RenameOFF.bat", "", @SW_HIDE )
    Beep (1500,250 )
    Beep (1000,250 )
    EndIf

    - Enable UWP by right clicking on Desktop an choose "Display Size" or "Personalize"
    - Disable UWP again by doubleclicking the shortcut on desktop