freddie-o, thanks for the great script! -RAM consumption is too high (1.5 GB from the first start and reboot) -I removed the lines from the script (21h2 ltsc) related to windows time services/tasks (this is too much)
These are MSMG Toolkit's options. Remove Components =>> Speech Recognition, WinUpdate and so on this tweak: Code: @echo off chcp 65001 >nul for /f "tokens=4 delims= " %%i in ('systeminfo ^| find /i "Total Physical Memory"') do (set mem=%%i) for /f "tokens=1 delims= " %%i in ('echo.%mem%') do (set memgb=%%i) set /a "memkb=%memgb%*1024*1024" reg add "HKLM\SYSTEM\ControlSet001\Control" /v "SvcHostSplitThresholdInKB" /t REG_DWORD /d "%memkb%" /f >nul exit
Hy @freddie-o With my found duplicates script https://forums.mydigitallife.net/threads/show-duplicates-in-a-sript.88470/ i found just one duplicate key in your script in line 62-138 Spoiler: line is duplicate reg add "HKLM\SOFTHIVE\Policies\Microsoft\Windows\WindowsUpdate" /v "DisableWindowsUpdateAccess" /t REG_DWORD /d "1" /f a very good job, thanks and we can add to complete the script : Delete or disable Windows firewall defender Service mpssvc (How delete it ???) Add Disable firewall Kb5034441 Fix Issue Windows 11( if you are disabling Windows Defender, you also need to disable Smart App Control) Lanman sharing service in manual mode Soft Delete files and folders Edge, Defender, Bing, Copilot (But there is an issue when you want to delete in the script this mpssvc service,(it says there is not complete at this line..) i can't remove it, I look it depends on the services needed BFE, and mpsdrv): Spoiler: Windows Firewall Defender service rem == windows firewall defender == reg delete "HKLM\SYSHIVE\ControlSet001\Services\mpssvc" /f or may be just disable it: reg add "HKLM\SYSHIVE\ControlSet001\Services\mpssvc" /v "Start" /t REG_DWORD /d "4" /f Spoiler: Add Disable Firewall rem == add Disable Firewall service == reg add "HKLM\SYSHIVE\ControlSet001\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile" /v "EnableFirewall" /t REG_DWORD /d "0" /f reg add "HKLM\SYSHIVE\ControlSet001\Services\SharedAccess\Parameters\FirewallPolicy\PublicProfile" /v "EnableFirewall" /t REG_DWORD /d "0" /f reg add "HKLM\SYSHIVE\ControlSet001\Services\SharedAccess\Parameters\FirewallPolicy\DomainProfile" /v "EnableFirewall" /t REG_DWORD /d "0" /f Spoiler: kb503441 fix rem == KB5034441_FIX == reg add "HKLM\SOFTHIVE\Microsoft\Windows NT\CurrentVersion" /v "WinREVersion" /t REG_SZ /d "10.0.19041.9999" /f Spoiler: turn off Smart App Control Windows 11 rem == Turn Off Smart App Control Windows 11 == reg add "HKLM\SYSHIVE\ControlSet001\Control\CI\Policy" /v "VerifiedAndReputablePolicyState" /t REG_DWORD /d "0" /f Spoiler: Lanman sharing service rem == Put Administrative sharing services in manual mode = reg add "HKLM\SYSHIVE\ControlSet001\Services\LanmanServer" /v "Start" /t REG_DWORD /d "3" /f reg add "HKLM\SYSHIVE\ControlSet001\Services\LanmanWorkstation" /v "Start" /t REG_DWORD /d "3" /f At the end of the script you can add: Edit :Rather at the beginning to the script to allow the keys to be created after the files have been deleted Spoiler: Soft Delete files and folders Edge, Defender, Bing, Copilot echo ========================================= rem == Done disabling telemetry == echo "Telemetry disabled" echo ========================================= echo ----------------------------------------- setlocal set "Keywords=Defender" echo ========================================================================== rem == Deletion of Files and Folders containing the words "Edge" and "Defender" == echo Deleting elements containing the keyword: "%Keywords%" except Windows\ echo ========================================================================== echo --------------------------------------------------------------------------------------- rem == Delete folders containing the keyword "Defender" in each path except Windows\ == echo === Delete folders containing the keyword "Defender" in each path except Windows\ === echo --------------------------------------------------------------------------------------- for /f "delims=" %%x in ('dir /b /ad /s "mount\Program Files (x86)\*%Keywords%*" 2^>nul') do ( if exist "%%x" ( rmdir /q /s "%%x" 2>nul if not exist "%%x" echo OK - Folder "%%x" deleted. ) ) for /f "delims=" %%x in ('dir /b /ad /s "mount\Program Files\*%Keywords%*" 2^>nul') do ( if exist "%%x" ( rmdir /q /s "%%x" 2>nul if not exist "%%x" echo OK - Folder "%%x" deleted. ) ) for /f "delims=" %%x in ('dir /b /ad /s "mount\ProgramData\*%Keywords%*" 2^>nul') do ( if exist "%%x" ( rmdir /q /s "%%x" 2>nul if not exist "%%x" echo OK - Folder "%%x" deleted. ) ) for /f "delims=" %%x in ('dir /b /ad /s "mount\Users\Administrateur\*%Keywords%*" 2^>nul') do ( if exist "%%x" ( rmdir /q /s "%%x" 2>nul if not exist "%%x" echo OK - Folder "%%x" deleted. ) ) echo --------------------------------------------------------------------------------------- rem == Delete files containing the keyword "Defender" in each path except Windows\== echo === Delete files containing the keyword "Defender" in each path except Windows\ === echo --------------------------------------------------------------------------------------- for /f "delims=" %%x in ('dir /b /a-d /s "mount\Program Files (x86)\*%Keywords%*" 2^>nul') do ( if exist "%%x" ( del /f /q "%%x" 2>nul if not exist "%%x" echo OK - File "%%x" deleted. ) ) for /f "delims=" %%x in ('dir /b /a-d /s "mount\Program Files\*%Keywords%*" 2^>nul') do ( if exist "%%x" ( del /f /q "%%x" 2>nul if not exist "%%x" echo OK - File "%%x" deleted. ) ) for /f "delims=" %%x in ('dir /b /a-d /s "mount\ProgramData\*%Keywords%*" 2^>nul') do ( if exist "%%x" ( del /f /q "%%x" 2>nul if not exist "%%x" echo OK - File "%%x" deleted. ) ) for /f "delims=" %%x in ('dir /b /a-d /s "mount\Users\Administrateur\*%Keywords%*" 2^>nul') do ( if exist "%%x" ( del /f /q "%%x" 2>nul if not exist "%%x" echo OK - File "%%x" deleted. ) ) echo --------------------------------------------------------------------------------------- set "Keywords1=Edge" echo ========================================================================== echo Deleting elements containing the keyword: "%Keywords1%" except Windows\ echo ========================================================================== echo --------------------------------------------------------------------------------------- rem == Delete folders containing the keyword "Edge" in each path except Windows\== echo === Delete folders containing the keyword "Edge" in each path except Windows\ === echo --------------------------------------------------------------------------------------- for /f "delims=" %%x in ('dir /b /ad /s "mount\Program Files (x86)\*%Keywords1%*" 2^>nul') do ( if exist "%%x" ( rmdir /q /s "%%x" 2>nul if not exist "%%x" echo OK - Folder "%%x" deleted. ) ) for /f "delims=" %%x in ('dir /b /ad /s "mount\Program Files\*%Keywords1%*" 2^>nul') do ( if exist "%%x" ( rmdir /q /s "%%x" 2>nul if not exist "%%x" echo OK - Folder "%%x" deleted. ) ) for /f "delims=" %%x in ('dir /b /ad /s "mount\ProgramData\*%Keywords1%*" 2^>nul') do ( if exist "%%x" ( rmdir /q /s "%%x" 2>nul if not exist "%%x" echo OK - Folder "%%x" deleted. ) ) for /f "delims=" %%x in ('dir /b /ad /s "mount\Users\Administrateur\*%Keywords1%*" 2^>nul') do ( if exist "%%x" ( rmdir /q /s "%%x" 2>nul if not exist "%%x" echo OK - Folder "%%x" deleted. ) ) echo --------------------------------------------------------------------------------------- rem == Delete files containing the keyword "Edge" in each path except Windows\== echo === Delete files containing the keyword "Edge" in each path except Windows\=== echo --------------------------------------------------------------------------------------- for /f "delims=" %%x in ('dir /b /a-d /s "mount\Program Files (x86)\*%Keywords1%*" 2^>nul') do ( if exist "%%x" ( del /f /q "%%x" 2>nul if not exist "%%x" echo OK - File "%%x" deleted. ) ) for /f "delims=" %%x in ('dir /b /a-d /s "mount\Program Files\*%Keywords1%*" 2^>nul') do ( if exist "%%x" ( del /f /q "%%x" 2>nul if not exist "%%x" echo OK - File "%%x" deleted. ) ) for /f "delims=" %%x in ('dir /b /a-d /s "mount\ProgramData\*%Keywords1%*" 2^>nul') do ( if exist "%%x" ( del /f /q "%%x" 2>nul if not exist "%%x" echo OK - File "%%x" deleted. ) ) for /f "delims=" %%x in ('dir /b /a-d /s "mount\Users\Administrateur\*%Keywords1%*" 2^>nul') do ( if exist "%%x" ( del /f /q "%%x" 2>nul if not exist "%%x" echo OK - File "%%x" deleted. ) ) echo --------------------------------------------------------------------------------------- rem == Delete additional "Edge", "Defender", "Windows Search", "Hello" folders in Windows == echo === Delete folders containing "Edge", "Defender", "Hello" in Windows\ === echo --------------------------------------------------------------------------------------- for %%x in ( "mount\Windows\SystemApps\Microsoft.MicrosoftEdge_8wekyb3d8bbwe" "mount\Windows\SystemApps\Microsoft.MicrosoftEdgeDevToolsClient_8wekyb3d8bbwe" "mount\Windows\System32\Tasks\Microsoft\Windows\Windows Defender" "mount\Windows\System32\Windowspowershell\V1.0\Modules\configdefender" "mount\Windows\System32\Windowspowershell\V1.0\Modules\configdefenderperformance" "mount\Windows\System32\Windowspowershell\V1.0\Modules\defender" "mount\Windows\Syswow64\Windowspowershell\V1.0\Modules\defender" "mount\Windows\System32\Tasks\Microsoft\Windows\helloface" ) do ( if exist "%%x" ( rmdir /q /s "%%x" 2>nul if not exist "%%x" echo OK - Folder "%%x" deleted. ) ) echo --------------------------------------------------------------------------------------- rem == Delete files "Bing" and "Copilot" in Windows\InboxApps == echo === Delete files "Bing" and "Copilot" in Windows\InboxApps\ === echo --------------------------------------------------------------------------------------- for %%x in ( "mount\Windows\InboxApps\Microsoft.BingSearch_8wekyb3d8bbwe.msixbundle" "mount\Windows\InboxApps\Microsoft.BingSearch_8wekyb3d8bbwe.xml" "mount\Windows\InboxApps\Microsoft.Copilot_8wekyb3d8bbwe.msix" "mount\Windows\InboxApps\Microsoft.Copilot_8wekyb3d8bbwe.xml" ) do ( if exist "%%x" ( del /f /q "%%x" 2>nul if not exist "%%x" echo OK - File "%%x" deleted. ) ) endlocal echo --------------------------------------------------------------------------------------- echo --------------------------------------------------------------------------------------- Spoiler: Here's the result of what it does for Soft delete files and folders for my custom LTSC in a mount folder named C:\up ========================================= "Telemetry disabled" ========================================= ----------------------------------------- ========================================================================== Deleting elements containing the keyword: "Defender" except Windows\ ========================================================================== --------------------------------------------------------------------------------------- === Delete folders containing the keyword "Defender" in each path except Windows\ === --------------------------------------------------------------------------------------- OK - Folder "C:\up\mount\Program Files (x86)\Windows Defender" deleted. OK - Folder "C:\up\mount\Program Files\Windows Defender" deleted. OK - Folder "C:\up\mount\Program Files\Windows Defender Advanced Threat Protection" deleted. OK - Folder "C:\up\mount\ProgramData\Microsoft\Windows Defender" deleted. OK - Folder "C:\up\mount\ProgramData\Microsoft\Windows Defender Advanced Threat Protection" deleted. --------------------------------------------------------------------------------------- === Delete files containing the keyword "Defender" in each path except Windows\ === --------------------------------------------------------------------------------------- OK - File "C:\up\mount\ProgramData\Microsoft\Windows\Start Menu\Programs\Administrative Tools\Windows Defender Firewall with Advanced Security.lnk" deleted. --------------------------------------------------------------------------------------- ========================================================================== Deleting elements containing the keyword: "Edge" except Windows\ ========================================================================== --------------------------------------------------------------------------------------- === Delete folders containing the keyword "Edge" in each path except Windows\ === --------------------------------------------------------------------------------------- OK - Folder "C:\up\mount\Program Files (x86)\Microsoft\Edge" deleted. OK - Folder "C:\up\mount\Program Files (x86)\Microsoft\EdgeCore" deleted. OK - Folder "C:\up\mount\Program Files (x86)\Microsoft\EdgeUpdate" deleted. OK - Folder "C:\up\mount\Program Files (x86)\Microsoft\EdgeWebView" deleted. OK - Folder "C:\up\mount\Program Files\WindowsApps\Microsoft.MicrosoftEdge.Stable_112.0.1722.39_neutral__8wekyb3d8bbwe" deleted. OK - Folder "C:\up\mount\ProgramData\Microsoft\EdgeUpdate" deleted. OK - Folder "C:\up\mount\ProgramData\Packages\Microsoft.MicrosoftEdge.Stable_8wekyb3d8bbwe" deleted. OK - Folder "C:\up\mount\Users\Administrateur\AppData\Local\Microsoft\Edge" deleted. OK - Folder "C:\up\mount\Users\Administrateur\AppData\Local\Microsoft\WindowsApps\Microsoft.MicrosoftEdge_8wekyb3d8bbwe" deleted. OK - Folder "C:\up\mount\Users\Administrateur\AppData\Local\Packages\Microsoft.MicrosoftEdge_8wekyb3d8bbwe" deleted. --------------------------------------------------------------------------------------- === Delete files containing the keyword "Edge" in each path except Windows\=== --------------------------------------------------------------------------------------- OK - File "C:\up\mount\Program Files\VideoLAN\VLC\plugins\video_filter\libedgedetection_plugin.dll" deleted. OK - File "C:\up\mount\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Edge.lnk" deleted. OK - File "C:\up\mount\Users\Administrateur\AppData\Local\Microsoft\WindowsApps\MicrosoftEdge.exe" deleted. --------------------------------------------------------------------------------------- === Delete folders containing "Edge", "Defender", "Hello" in Windows\ === --------------------------------------------------------------------------------------- OK - Folder ""mount\Windows\SystemApps\Microsoft.MicrosoftEdge_8wekyb3d8bbwe"" deleted. OK - Folder ""mount\Windows\SystemApps\Microsoft.MicrosoftEdgeDevToolsClient_8wekyb3d8bbwe"" deleted. OK - Folder ""mount\Windows\System32\Windowspowershell\V1.0\Modules\configdefender"" deleted. OK - Folder ""mount\Windows\System32\Windowspowershell\V1.0\Modules\configdefenderperformance"" deleted. OK - Folder ""mount\Windows\System32\Windowspowershell\V1.0\Modules\defender"" deleted. OK - Folder ""mount\Windows\Syswow64\Windowspowershell\V1.0\Modules\defender"" deleted. OK - Folder ""mount\Windows\System32\Tasks\Microsoft\Windows\helloface"" deleted. --------------------------------------------------------------------------------------- === Delete files "Bing" and "Copilot" in Windows\InboxApps\ === --------------------------------------------------------------------------------------- OK - File ""mount\Windows\InboxApps\Microsoft.BingSearch_8wekyb3d8bbwe.msixbundle"" deleted. OK - File ""mount\Windows\InboxApps\Microsoft.BingSearch_8wekyb3d8bbwe.xml"" deleted. OK - File ""mount\Windows\InboxApps\Microsoft.Copilot_8wekyb3d8bbwe.msix"" deleted. OK - File ""mount\Windows\InboxApps\Microsoft.Copilot_8wekyb3d8bbwe.xml"" deleted. --------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------- Outil Gestion et maintenance des images de déploiement Version : 10.0.19041.3636 Fichier image : C:\up\install.wim Index de l’image : 1 Enregistrement de l’image [==========================100.0%==========================] Démontage de l’image [==========================100.0%==========================] L’opération a réussi. Outil Gestion et maintenance des images de déploiement Version : 10.0.19041.3636 Exportation de l’image [==========================100.0%==========================] L’opération a réussi. Appuyez sur une touche pour continuer...
This was fixed already in the latest script(s) I had to leave "mpssvc" service alone because deleting it causes the OS to be unstable Deleting these Services causes instabilty Code: AppXSvc BFE ClipSVC camsvc InstallService NcbService PushToInstall PolicyAgent mpssvc Wecsvc EventLog This was added already in the latest script(s) When I have time I'll look more into this
you can add at this section: Spoiler: rem == disable advertising info and tracking app launches == reg add "HKLM\NTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "ClearRecentDocsOnExit" /t REG_DWORD /d "1" /f reg add "HKLM\NTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "ShowFrequent" /t REG_DWORD /d "0" /f reg add "HKLM\NTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "ShowRecent" /t REG_DWORD /d "0" /f Spoiler: rem == microsoft edge == reg delete "HKLM\SYSHIVE\ControlSet001\Services\MicrosoftEdgeElevationService" /f and just an improvement; Spoiler: Open file Explorer on "This PC" rem == Explorer - Open file explorer on "This PC" == reg add "HKLM\SOFTHIVE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "LaunchTo" /t REG_DWORD /d "1" /f
Best if I just stick to Telemetry related stuff I'll have test this first fully on a running system to see how it impacts the OS
These entries on my script don't cut it? Code: rem == disable advertising info and tracking app launches == reg add "HKLM\NTUSER\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" /v "Enabled" /t REG_DWORD /d "0" /f reg add "HKLM\NTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "Start_TrackProgs" /t REG_DWORD /d "0" /f reg add "HKLM\NTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoRecentDocsHistory" /t REG_DWORD /d "1" /f reg add "HKLM\NTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoResolveTrack" /t REG_DWORD /d "1" /f reg add "HKLM\NTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoInstrumentation" /t REG_DWORD /d "1" /f Couldn't find this Service in my OS What Windows version?
Updated disable_telemetry scripts https://forums.mydigitallife.net/th...lemetry-repository.63874/page-66#post-1686849 Disabled more Windows Firewall telemetry (Thanks to @Acideb135 ) Code: reg add "HKLM\SOFTHIVE\Policies\Microsoft\WindowsFirewall\PublicProfile" /v "EnableFirewall" /t REG_DWORD /d "0" /f reg add "HKLM\SYSHIVE\ControlSet001\Services\SharedAccess\Parameters\FirewallPolicy\DomainProfile" /v "EnableFirewall" /t REG_DWORD /d "0" /f reg add "HKLM\SYSHIVE\ControlSet001\Services\SharedAccess\Parameters\FirewallPolicy\PublicProfile" /v "EnableFirewall" /t REG_DWORD /d "0" /f reg add "HKLM\SYSHIVE\ControlSet001\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile" /v "EnableFirewall" /t REG_DWORD /d "0" /f reg add "HKLM\SYSHIVE\ControlSet001\Services\mpsdrv" /v "Start" /t REG_DWORD /d "4" /f reg add "HKLM\SYSHIVE\ControlSet001\Services\mpssvc" /v "Start" /t REG_DWORD /d "4" /f