Advertisement
the_vvvvvvvvvv

Windows 10 Enterprise LTSB - Big tweak

Aug 8th, 2015
2,580
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 40.61 KB | None | 0 0
  1. REM Tweak Script for Windows 10 Enterprise N LTSB x64 en-US
  2. REM VERSION: 1.23   DATE LAST MODIFIED: 2015-08-19      CREATED BY: ERICGL
  3. REM During Win10 installation, select Customize Settings, and turn everything OFF.
  4. REM Also during Win10 installation, use a local account, not a Microsoft account. Click "Skip this step" at the bottom.
  5. REM
  6. REM WARNING!!
  7. REM BEFORE APPLYING ANY OF THE COMMANDS IN THIS SCRIPT,
  8. REM BACKUP YOUR ENTIRE REGISTRY TO A FILE!
  9. REM Open Regedit.exe > File > Export.
  10. REM Make sure "Export range" is set to All, give it an appropriate name and save in a convenient location.
  11. REM
  12. REM Download SetACL from here: https://helgeklein.com/downloads/SetACL/current/SetACL%20(executable%20version).zip
  13. REM NOTE: This app is required in order to give Administrators ownership of locked registry keys. It’s perfectly safe to use.
  14. REM Extract SetACl.exe from the 64bit folder and rename it to SetACLx64.exe. Copy SetACLx64.exe to %SystemRoot%\System32 (Allow through UAC).
  15. REM
  16. REM Changes in registry do not reflect back to GPEDIT.MSC. Better to do it directly through GPEDIT.MSC UI.
  17. REM
  18. REM OK, LET'S BEGIN
  19. REM
  20. @echo off
  21.  
  22. set SetACL=%SystemRoot%\System32\SetACLx64.exe
  23. set NoIP=127.0.0.0
  24. set AdminsGroup=Administrators
  25. set NewTemp=%SYSTEMDRIVE%\TEMP
  26. set NewDownloads=%SYSTEMDRIVE%\DOWNLOADS
  27.  
  28.  
  29. net session >nul 2>nul || (echo Run as administrator, please... &pause &exit /b)
  30. ver | findstr "10." || (echo Only for Windows 10... &pause)
  31. if not exist %SetACL% (echo Please setup SetACL... &pause &exit /b)
  32.  
  33.  
  34. REM *** change all Temp directories to C:\TEMP (environment variables) ***
  35. md %NewTemp%
  36. call :AddReg "HKU\.DEFAULT\Environment" "TEMP" REG_EXPAND_SZ %NewTemp%
  37. call :AddReg "HKU\.DEFAULT\Environment" "TMP" REG_EXPAND_SZ %NewTemp%
  38. call :AddReg "HKCU\Environment" "TEMP" REG_EXPAND_SZ %NewTemp%
  39. call :AddReg "HKCU\Environment" "TMP" REG_EXPAND_SZ %NewTemp%
  40. call :AddReg "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "TEMP" REG_EXPAND_SZ %NewTemp%
  41. call :AddReg "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "TMP" REG_EXPAND_SZ %NewTemp%
  42. call :DelDirForced "%USERPROFILE%\AppData\Local\Temp"
  43. call :DelDirForced "%SystemRoot%\Temp"
  44.  
  45.  
  46. REM *** Don't allow Windows 10 to repair itself from Windows Update (define alternate repair source, such as network location or WIM file) ***
  47. REM ***  VERY RISKY!!! MAKE SURE YOU KNOW WHAT YOU'RE DOING .***
  48. REM *** Instead of Windows Update, I set it to use 0.0.0.0, which means it won't be able to find a repair source ***
  49. REM *** This setting is located at GPEDIT.MSC > Computer Configuration > Administrative Templates > System: Specify settings for optional installation and component repair ***
  50. REM *** If you prefer to use the GPEDIT.MSC UI, Enable the setting, type an alternate repair source and CHECK "Never attempt to download payload from Windows Update" ***
  51. REM *** Info source: https://technet.microsoft.com/en-us/library/hh825020.aspx#BKMK_Specify ***
  52. call :AddReg "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy Objects\{7C0F6EBB-E44C-48D1-82A9-0561C4650831}Machine\Software\Microsoft\Windows\CurrentVersion\Policies\Servicing"
  53. call :AddReg "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy Objects\{7C0F6EBB-E44C-48D1-82A9-0561C4650831}Machine\Software\Microsoft\Windows\CurrentVersion\Policies\Servicing" "**del.RepairContentServerSource" REG_SZ " "
  54. call :AddReg "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy Objects\{7C0F6EBB-E44C-48D1-82A9-0561C4650831}Machine\Software\Microsoft\Windows\CurrentVersion\Policies\Servicing" "LocalSourcePath" REG_EXPAND_SZ %NoIP%
  55. call :AddReg "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy Objects\{7C0F6EBB-E44C-48D1-82A9-0561C4650831}Machine\Software\Microsoft\Windows\CurrentVersion\Policies\Servicing" "UseWindowsUpdate" REG_DWORD 2
  56. call :AddReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Servicing"
  57. call :AddReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Servicing" "LocalSourcePath" REG_EXPAND_SZ %NoIP%
  58. call :AddReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Servicing" "UseWindowsUpdate" REG_DWORD 2
  59.  
  60.  
  61. REM *** Remove the Previous Versions tab, which appears when right-clicking a file > Properties ***
  62. call :AddReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" "NoPreviousVersionsPage" REG_DWORD 1
  63.  
  64.  
  65. REM *** Disable Disk Quota tab, which appears as a tab when right-clicking on drive letter > Properties ***
  66. call :AddReg "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\DiskQuota" "Enable" REG_DWORD 0
  67.  
  68.  
  69. REM *** Remove Application Telemetry - WINDOWS 7 ONLY!! ***
  70. call :AddReg "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\AIT" "AITEnable" REG_DWORD 0
  71.  
  72. REM *** Remove Telemetry & Data Collection ***
  73. call :AddReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Device Metadata" PreventDeviceMetadataFromNetwork REG_DWORD 1
  74. call :AddReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" "AllowTelemetry" REG_DWORD 0
  75. call :AddReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Channels\Microsoft-Windows-Application-Experience/Program-Telemetry" "Enabled" REG_DWORD 0
  76. call :AddReg "HKLM\SOFTWARE\Policies\Microsoft\MRT" DontOfferThroughWUAU REG_DWORD 1
  77. call :AddReg "HKLM\SOFTWARE\Policies\Microsoft\SQMClient\Windows" "CEIPEnable" REG_DWORD 0
  78. call :AddReg "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppCompat" "AITEnable" REG_DWORD 0
  79. call :AddReg "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppCompat" "DisableUAR" REG_DWORD 1
  80. call :AddReg "HKLM\SOFTWARE\Policies\Microsoft\Windows\DataCollection" "AllowTelemetry" REG_DWORD 0
  81. call :AddReg "HKLM\SYSTEM\CurrentControlSet\Control\WMI\AutoLogger\AutoLogger-Diagtrack-Listener" "Start" REG_DWORD 0
  82. call :AddReg "HKLM\SYSTEM\CurrentControlSet\Control\WMI\AutoLogger\SQMLogger" "Start" REG_DWORD 0
  83. call :AddReg "HKLM\SYSTEM\CurrentControlSet\Control\WMI\AutoLogger\TCPIPLOGGER" "Start" REG_DWORD 0
  84. call :AddReg "HKLM\SYSTEM\CurrentControlSet\Control\WMI\AutoLogger\ReadyBoot" "Start" REG_DWORD 0
  85.  
  86.  
  87. *** Don't allow Windows Defender to submit samples to MAPS (formerly SpyNet) ***
  88. REM Changes in registry do not reflect back to GPEDIT.MSC. Better to do it directly through GPEDIT.MSC UI.
  89. REM Or in this case through: Settings > Update & Security > Windows Defender
  90. call :AddReg "HKLM\SOFTWARE\Microsoft\Windows Defender\Spynet" "SpyNetReporting" REG_DWORD 0
  91. call :AddReg "HKLM\SOFTWARE\Microsoft\Windows Defender\Spynet" "SubmitSamplesConsent" REG_DWORD 0
  92.  
  93.  
  94. REM *** Set some IE11 settings. Pay Attention to Download folder location (change to your preferred location)!! ***
  95. md %NewDownloads%
  96. call :AddReg "HKCU\SOFTWARE\Microsoft\Internet Explorer\Main" "Default Download Directory" REG_SZ "%NewDownloads%"
  97. call :AddReg "HKCU\SOFTWARE\Microsoft\Internet Explorer\Main" "DoNotTrack" REG_DWORD 1
  98. call :AddReg "HKCU\SOFTWARE\Microsoft\Internet Explorer\Main" "Search Page" REG_SZ "http://www.google.com"
  99. call :AddReg "HKCU\SOFTWARE\Microsoft\Internet Explorer\Main" "Start Page Redirect Cache" REG_SZ "http://www.google.com/?noj=1"
  100.  
  101.  
  102. REM *** add Google as search provider for IE11, and make it the default ***
  103. call :AddReg "HKCU\SOFTWARE\Microsoft\Internet Explorer\SearchScopes" "DefaultScope" REG_SZ "{89418666-DF74-4CAC-A2BD-B69FB4A0228A}"
  104. call :AddReg "HKCU\SOFTWARE\Microsoft\Internet Explorer\SearchScopes\{89418666-DF74-4CAC-A2BD-B69FB4A0228A}"
  105. call :AddReg "HKCU\SOFTWARE\Microsoft\Internet Explorer\SearchScopes\{89418666-DF74-4CAC-A2BD-B69FB4A0228A}" "DisplayName" REG_SZ "Google"
  106. call :AddReg "HKCU\SOFTWARE\Microsoft\Internet Explorer\SearchScopes\{89418666-DF74-4CAC-A2BD-B69FB4A0228A}" "FaviconURL" REG_SZ "http://www.google.com/favicon.ico"
  107. call :AddReg "HKCU\SOFTWARE\Microsoft\Internet Explorer\SearchScopes\{89418666-DF74-4CAC-A2BD-B69FB4A0228A}" "FaviconURLFallback" REG_SZ "http://www.google.com/favicon.ico"
  108. call :AddReg "HKCU\SOFTWARE\Microsoft\Internet Explorer\SearchScopes\{89418666-DF74-4CAC-A2BD-B69FB4A0228A}" "OSDFileURL" REG_SZ "http://www.iegallery.com/en-us/AddOns/DownloadAddOn?resourceId=813"
  109. call :AddReg "HKCU\SOFTWARE\Microsoft\Internet Explorer\SearchScopes\{89418666-DF74-4CAC-A2BD-B69FB4A0228A}" "ShowSearchSuggestions" REG_DWORD 1
  110. call :AddReg "HKCU\SOFTWARE\Microsoft\Internet Explorer\SearchScopes\{89418666-DF74-4CAC-A2BD-B69FB4A0228A}" "SuggestionsURL" REG_SZ "http://clients5.google.com/complete/search?q={searchTerms}&client=ie8&mw={ie:maxWidth}&sh={ie:sectionHeight}&rh={ie:rowHeight}&inputencoding={inputEncoding}&outputencoding={outputEncoding}"
  111. call :AddReg "HKCU\SOFTWARE\Microsoft\Internet Explorer\SearchScopes\{89418666-DF74-4CAC-A2BD-B69FB4A0228A}" "SuggestionsURLFallback" REG_SZ "http://clients5.google.com/complete/search?hl={language}&q={searchTerms}&client=ie8&inputencoding={inputEncoding}&outputencoding={outputEncoding}"
  112. call :AddReg "HKCU\SOFTWARE\Microsoft\Internet Explorer\SearchScopes\{89418666-DF74-4CAC-A2BD-B69FB4A0228A}" "TopResultURLFallback" REG_SZ ""
  113. call :AddReg "HKCU\SOFTWARE\Microsoft\Internet Explorer\SearchScopes\{89418666-DF74-4CAC-A2BD-B69FB4A0228A}" "URL" REG_SZ "http://www.google.com/search?q={searchTerms}&sourceid=ie7&rls=com.microsoft:{language}:{referrer:source}&ie={inputEncoding?}&oe={outputEncoding?}"
  114.  
  115.  
  116. REM *** Change how Windows Updates are delivered to you - allow only directly from Microsoft ***
  117. REM 0 = Off (only directly from Microsoft)
  118. REM 1 = Get updates from Microsoft and PCs on your local network
  119. REM 3 = Get updates from Microsoft, PCs on your local network & PCs on the Internet (like how torrents work)
  120. call :AddReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" "DODownloadMode" REG_DWORD 0
  121.  
  122.  
  123. REM *** Windows Update - Notify first (These settings are also available in GPEDIT.MSC) ***
  124. REM GPEDIT.MSC > Computer Configuration > Administrative Templates > Windows Components > Windows Update
  125. net stop wuauserv
  126. call :AddReg "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" "AutoInstallMinorUpdates" REG_DWORD 0
  127. call :AddReg "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" "AUOptions" REG_DWORD 2
  128. call :AddReg "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" "NoAutoUpdate" REG_DWORD 0
  129. net start wuauserv
  130.  
  131.  
  132. REM *** Disable Cortana (Speech Search Assistant, which also sends information to Microsoft) ***
  133. call :AddReg "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" "CortanaEnabled" REG_DWORD 0
  134. call :AddReg "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" "AllowCortana" REG_DWORD 0
  135.  
  136.  
  137. REM *** Disable Cortana Telemetry ***
  138. rem call :AddReg "HKLM\COMPONENTS\DerivedData\Components\amd64_microsoft-windows-c..lemetry.lib.cortana_31bf3856ad364e35_10.0.10240.16384_none_40ba2ec3d03bceb0" "f!dss-winrt-telemetry.js" REG_DWORD 0
  139. rem call :AddReg "HKLM\COMPONENTS\DerivedData\Components\amd64_microsoft-windows-c..lemetry.lib.cortana_31bf3856ad364e35_10.0.10240.16384_none_40ba2ec3d03bceb0" "f!proactive-telemetry.js" REG_DWORD 0
  140. rem call :AddReg "HKLM\COMPONENTS\DerivedData\Components\amd64_microsoft-windows-c..lemetry.lib.cortana_31bf3856ad364e35_10.0.10240.16384_none_40ba2ec3d03bceb0" "f!proactive-telemetry-event_8ac43a41e5030538" REG_DWORD 0
  141. rem call :AddReg "HKLM\COMPONENTS\DerivedData\Components\amd64_microsoft-windows-c..lemetry.lib.cortana_31bf3856ad364e35_10.0.10240.16384_none_40ba2ec3d03bceb0" "f!proactive-telemetry-inter_58073761d33f144b" REG_DWORD 0
  142.  
  143.  
  144. REM *** Hide the search box from taskbar. You can still search by pressing the Win key and start typing what you're looking for ***
  145. REM 0 = hide completely, 1 = show only icon, 2 = show long search box
  146. call :AddReg "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" "SearchboxTaskbarMode" REG_DWORD 0
  147. call :AddReg "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" "BingSearchEnabled" REG_DWORD 0
  148.  
  149.  
  150. REM *** Disable MRU lists (jump lists) of XAML apps in Start Menu ***
  151. call :AddReg "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "Start_TrackDocs" REG_DWORD 0
  152.  
  153.  
  154. REM *** Set Windows Explorer to start on This PC instead of Quick Access ***
  155. REM 1 = This PC, 2 = Quick access
  156. call :AddReg "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "LaunchTo" REG_DWORD 1
  157.  
  158.  
  159. REM *** Show Computer shortcut on desktop ***
  160. REM 0 = show icon, 1 = don't show icon
  161. call :AddReg "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" REG_DWORD 0
  162.  
  163.  
  164. REM *** Show Network shortcut on desktop ***
  165. REM 0 = show icon, 1 = don't show icon
  166. call :AddReg "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" "{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}" REG_DWORD 0
  167.  
  168.  
  169. REM *** Change Clock and Date formats 24H, metric (Sign out required to see changes) ***
  170. call :AddReg "HKCU\Control Panel\International" "iMeasure" REG_SZ "0"
  171. call :AddReg "HKCU\Control Panel\International" "iNegCurr" REG_SZ "1"
  172. call :AddReg "HKCU\Control Panel\International" "iTime" REG_SZ "1"
  173. call :AddReg "HKCU\Control Panel\International" "sShortDate" REG_SZ "yyyy/MM/dd"
  174. call :AddReg "HKCU\Control Panel\International" "sShortTime" REG_SZ "HH:mm"
  175. call :AddReg "HKCU\Control Panel\International" "sTimeFormat" REG_SZ "H:mm:ss"
  176.  
  177.  
  178. REM *** Set Notepad to Arial font, Size 11, Hebrew script charset, WordWrap On ****
  179. call :AddReg "HKCU\SOFTWARE\Microsoft\Notepad" "lfFaceName" REG_SZ "Arial"
  180. call :AddReg "HKCU\SOFTWARE\Microsoft\Notepad" "iPointSize" REG_DWORD 110
  181. call :AddReg "HKCU\SOFTWARE\Microsoft\Notepad" "lfCharSet" REG_DWORD 177
  182. call :AddReg "HKCU\SOFTWARE\Microsoft\Notepad" "fWrap" REG_DWORD 1
  183.  
  184.  
  185. REM *** Add "Take Ownership" on right-click menu of files & folders (with shield icon) ***
  186. call :AddReg "HKCR\*\shell\runas" "HasLUAShield" REG_SZ ""
  187. call :AddReg "HKCR\*\shell\runas" "NoWorkingDirectory" REG_SZ ""
  188. call :AddReg "HKCR\*\shell\runas" REG_SZ "Take ownership"
  189. call :AddReg "HKCR\*\shell\runas\command"                   REG_SZ "cmd.exe /c takeown \""%%%%1\"" /a && icacls \""%%%%1\"" /grant %AdminsGroup%:F"
  190. call :AddReg "HKCR\*\shell\runas\command" "IsolatedCommand" REG_SZ "cmd.exe /c takeown \""%%%%1\"" /a && icacls \""%%%%1\"" /grant %AdminsGroup%:F"
  191. call :AddReg "HKCR\Directory\shell\runas" "HasLUAShield" REG_SZ ""
  192. call :AddReg "HKCR\Directory\shell\runas" "NoWorkingDirectory" REG_SZ ""
  193. call :AddReg "HKCR\Directory\shell\runas" REG_SZ "Take ownership"
  194. call :AddReg "HKCR\Directory\shell\runas\command"
  195. call :AddReg "HKCR\Directory\shell\runas\command"                   REG_SZ "cmd.exe /c takeown \""%%%%1\"" /a /r y && icacls \""%%%%1\"" /grant %AdminsGroup%:F"
  196. call :AddReg "HKCR\Directory\shell\runas\command" "IsolatedCommand" REG_SZ "cmd.exe /c takeown \""%%%%1\"" /a /r y && icacls \""%%%%1\"" /grant %AdminsGroup%:F"
  197.  
  198.  
  199. REM *** Enable Developer Mode (enables you to run XAML apps you develop in Visual Studio which haven't been certified yet) ***
  200. REM Computer Configuration > Administrative Templates > Windows Components > App Package Deployment
  201. REM Enabling these settings in GPEDIT will grey-out those options in SETTINGS > Update & Security > For Developers
  202. REM source: https://msdn.microsoft.com/library/windows/apps/xaml/dn706236.aspx
  203. call :AddReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" "AllowAllTrustedApps" REG_DWORD 1
  204. call :AddReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" "AllowDevelopmentWithoutDevLicense " REG_DWORD 1
  205.  
  206.  
  207. REM *** Change Mouse cursors to Extra Large Black ***
  208. call :AddReg "HKCU\Control Panel\Cursors" REG_SZ "Windows Black [extra large]"
  209. call :AddReg "HKCU\Control Panel\Cursors" "Hand" REG_EXPAND_SZ %%SystemRoot%%\cursors\aero_link_xl.cur
  210. call :AddReg "HKCU\Control Panel\Cursors" "Arrow" REG_EXPAND_SZ %%SystemRoot%%\cursors\arrow_rl.cur
  211. call :AddReg "HKCU\Control Panel\Cursors" "IBeam" REG_EXPAND_SZ %%SystemRoot%%\cursors\beam_rl.cur
  212. call :AddReg "HKCU\Control Panel\Cursors" "Wait" REG_EXPAND_SZ %%SystemRoot%%\cursors\busy_rl.cur
  213. call :AddReg "HKCU\Control Panel\Cursors" "Crosshair" REG_EXPAND_SZ %%SystemRoot%%\cursors\cross_rl.cur
  214. call :AddReg "HKCU\Control Panel\Cursors" "Help" REG_EXPAND_SZ %%SystemRoot%%\cursors\help_rl.cur
  215. call :AddReg "HKCU\Control Panel\Cursors" "SizeAll" REG_EXPAND_SZ %%SystemRoot%%\cursors\move_rl.cur
  216. call :AddReg "HKCU\Control Panel\Cursors" "No" REG_EXPAND_SZ %%SystemRoot%%\cursors\no_rl.cur
  217. call :AddReg "HKCU\Control Panel\Cursors" "NWPen" REG_EXPAND_SZ %%SystemRoot%%\cursors\pen_rl.cur
  218. call :AddReg "HKCU\Control Panel\Cursors" "SizeNESW" REG_EXPAND_SZ %%SystemRoot%%\cursors\size1_rl.cur
  219. call :AddReg "HKCU\Control Panel\Cursors" "SizeNWSE" REG_EXPAND_SZ %%SystemRoot%%\cursors\size2_rl.cur
  220. call :AddReg "HKCU\Control Panel\Cursors" "SizeWE" REG_EXPAND_SZ %%SystemRoot%%\cursors\size3_rl.cur
  221. call :AddReg "HKCU\Control Panel\Cursors" "SizeNS" REG_EXPAND_SZ %%SystemRoot%%\cursors\size4_rl.cur
  222. call :AddReg "HKCU\Control Panel\Cursors" "UpArrow" REG_EXPAND_SZ %%SystemRoot%%\cursors\up_rl.cur
  223. call :AddReg "HKCU\Control Panel\Cursors" "AppStarting" REG_EXPAND_SZ %%SystemRoot%%\cursors\wait_rl.cur
  224.  
  225.  
  226. REM *** Lock the Taskbar ***
  227. call :AddReg "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "TaskbarSizeMove" REG_DWORD 0
  228.  
  229.  
  230. REM *** Delay Taskbar thumbnail pop-ups to 10 seconds ***
  231. call :AddReg "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "ExtendedUIHoverTime" REG_DWORD "10000"
  232.  
  233.  
  234. REM *** Enable verbose status messages when you sign in/out of Windows ***
  235. REM In Win7, Better to do it via GPEDIT.MSC, as it also updates the POL file (GPEDIT option is missing in Win10).
  236. REM GPEDIT.MSC > Computer Configuration > Administrative Templates > System: Verbose vs normal status messages. Set to "Enabled".
  237. call :AddReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" "VerboseStatus" REG_DWORD 1
  238.  
  239.  
  240.  
  241. REM *** Turn OFF Sticky Keys when SHIFT is pressed 5 times ***
  242. REM 506 = Off, 510 = On (default)
  243. call :AddReg "HKCU\Control Panel\Accessibility\StickyKeys" "Flags" REG_SZ "506"
  244.  
  245.  
  246. REM *** Turn OFF Filter Keys when SHIFT is pressed for 8 seconds ***
  247. REM 122 = Off, 126 = On (default)
  248. call :AddReg "HKCU\Control Panel\Accessibility\Keyboard Response" "Flags" REG_SZ "122"
  249.  
  250.  
  251. REM *** Underline keyboard shortcuts and access keys ***
  252. call :AddReg "HKCU\Control Panel\Accessibility\Keyboard Preference" "On" REG_SZ 1
  253.  
  254.  
  255. REM *** Use Windows Photo Viewer to open photo files (Enterprise LTSB default is MSPAINT) ***
  256. call :AddReg "HKCU\Software\Classes\.jpg" REG_SZ "PhotoViewer.FileAssoc.Tiff"
  257. call :AddReg "HKCU\Software\Classes\.jpeg" REG_SZ "PhotoViewer.FileAssoc.Tiff"
  258. call :AddReg "HKCU\Software\Classes\.gif" REG_SZ "PhotoViewer.FileAssoc.Tiff"
  259. call :AddReg "HKCU\Software\Classes\.png" REG_SZ "PhotoViewer.FileAssoc.Tiff"
  260. call :AddReg "HKCU\Software\Classes\.bmp" REG_SZ "PhotoViewer.FileAssoc.Tiff"
  261. call :AddReg "HKCU\Software\Classes\.tiff" REG_SZ "PhotoViewer.FileAssoc.Tiff"
  262. call :AddReg "HKCU\Software\Classes\.ico" REG_SZ "PhotoViewer.FileAssoc.Tiff"
  263. call :AddReg "HKCR\Applications\photoviewer.dll\shell\open" "MuiVerb" REG_SZ "@photoviewer.dll,-3043"
  264. call :AddReg "HKCR\Applications\photoviewer.dll\shell\open\DropTarget"  "Clsid" REG_SZ "{FFE2A43C-56B9-4bf5-9A79-CC6D4285608A}"
  265. call :AddReg "HKCR\Applications\photoviewer.dll\shell\print\DropTarget" "Clsid" REG_SZ "{60fd46de-f830-4894-a628-6fa81bc0190d}"
  266. call :AddReg "HKCR\Applications\photoviewer.dll\shell\open\command"  REG_EXPAND_SZ "%%%%SystemRoot%%%%\System32\rundll32.exe ""%%%%ProgramFiles%%%%\Windows Photo Viewer\PhotoViewer.dll"", ImageView_Fullscreen %%%%1"
  267. call :AddReg "HKCR\Applications\photoviewer.dll\shell\print\command" REG_EXPAND_SZ "%%%%SystemRoot%%%%\System32\rundll32.exe ""%%%%ProgramFiles%%%%\Windows Photo Viewer\PhotoViewer.dll"", ImageView_Fullscreen %%%%1"
  268.  
  269.  
  270. REM *** Win10 - Enable dark theme on XAML (Modern UI) apps [sign out required] ***
  271. call :AddReg "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize" "AppsUseLightTheme" REG_DWORD 0
  272. call :AddReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize" "AppsUseLightTheme" REG_DWORD 0
  273.  
  274.  
  275. REM *** Remove Libraries - RISKY!! ***
  276. call :DelReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{031E4825-7B94-4dc3-B131-E946B44C8DD5}"
  277. call :DelReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{59BD6DD1-5CEC-4d7e-9AD2-ECC64154418D}"
  278. call :DelReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{C4D98F09-6124-4fe0-9942-826416082DA9}"
  279. call :DelReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\UsersLibraries"
  280. call :DelRegClsIDForced "{031E4825-7B94-4dc3-B131-E946B44C8DD5}"
  281. call :DelRegClsIDForced "{1CF324EC-F905-4c69-851A-DDC8795F71F2}"
  282. call :DelRegClsIDForced "{51F649D3-4BFF-42f6-A253-6D878BE1651D}"
  283. call :DelRegClsIDForced "{896664F7-12E1-490f-8782-C0835AFD98FC}"
  284. call :DelRegClsIDForced "{c51b83e5-9edd-4250-b45a-da672ee3c70e}"
  285. call :DelRegClsIDForced "{e9711a2f-350f-4ec1-8ebd-21245a8b9376}"
  286. call :DelRegForced "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Windows.NavPaneShowLibraries"
  287. call :DelRegForced "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\SettingSync\Namespace\Windows\UserLibraries"
  288. call :DelRegForced "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\SettingSync\WindowsSettingHandlers\UserLibraries"
  289. call :DelRegForced "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Windows.NavPaneShowLibraries"
  290. call :DelRegForced "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\SettingSync\Namespace\Windows\UserLibraries"
  291. call :DelRegForced "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\SettingSync\WindowsSettingHandlers\UserLibraries"
  292. call :DelReg "HKCU\SOFTWARE\Classes\Local Settings\MuiCache\1\52C64B7E" "@C:\Windows\system32\windows.storage.dll,-50691"
  293.  
  294.  
  295. REM *** Remove "Show Libraries" from Folder Options -> View tab (Advanced Settings) ***
  296. call :DelReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\NavPane\ShowLibraries"
  297.  
  298.  
  299. REM *** Remove Music, Pictures & Videos from Start Menu places (Settings > Personalization > Start > Choose which folders appear on Start) ***
  300. del "%ProgramData%\Microsoft\Windows\Start Menu Places\05 - Music.lnk"
  301. del "%ProgramData%\Microsoft\Windows\Start Menu Places\06 - Pictures.lnk"
  302. del "%ProgramData%\Microsoft\Windows\Start Menu Places\07 - Videos.lnk"
  303.  
  304.  
  305. REM *** Remove Music, Pictures & Videos from Libraries ***
  306. del "%APPDATA%\Microsoft\Windows\Libraries\Music.library-ms"
  307. del "%APPDATA%\Microsoft\Windows\Libraries\Pictures.library-ms"
  308. del "%APPDATA%\Microsoft\Windows\Libraries\Videos.library-ms"
  309.  
  310.  
  311. REM *** Remove Music (appears under This PC in File Explorer) ***
  312. call :DelReg "HKCR\SystemFileAssociations\MyMusic"
  313. call :DelReg "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "My Music"
  314. call :DelReg "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" "My Music"
  315. call :DelReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{3f2a72a7-99fa-4ddb-a5a8-c604edf61d6b}"
  316. call :DelReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{1CF1260C-4DD0-4ebb-811F-33C572699FDE}"
  317. call :DelReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3dfdf296-dbec-4fb4-81d1-6a3438bcf4de}"
  318. call :DelReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "CommonMusic"
  319. call :DelReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" "CommonMusic"
  320. call :DelReg "HKU\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "My Music"
  321. call :DelReg "HKU\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" "My Music"
  322. call :DelReg "HKU\S-1-5-19\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" "My Music"
  323. call :DelReg "HKU\S-1-5-20\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" "My Music"
  324. call :DelRegClsIDForced "{1CF1260C-4DD0-4ebb-811F-33C572699FDE}"
  325. call :DelRegClsIDForced "{3dfdf296-dbec-4fb4-81d1-6a3438bcf4de}"
  326.  
  327.  
  328. REM *** Remove Pictures (appears under This PC in File Explorer) ***
  329. call :DelReg "HKCR\SystemFileAssociations\MyPictures"
  330. call :DelReg "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "My Pictures"
  331. call :DelReg "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" "My Pictures"
  332. call :DelReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{0b2baaeb-0042-4dca-aa4d-3ee8648d03e5}"
  333. call :DelReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{4dcafe13-e6a7-4c28-be02-ca8c2126280d}"
  334. call :DelReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{c1f8339f-f312-4c97-b1c6-ecdf5910c5c0}"
  335. call :DelReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{24ad3ad4-a569-4530-98e1-ab02f9417aa8}"
  336. call :DelReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "CommonPictures"
  337. call :DelReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StartMenu\StartPanel\PinnedItems\Pictures"
  338. call :DelReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" "CommonPictures"
  339. call :DelReg "HKU\.DEFAULT\Software\Classes\Local Settings\MuiCache\1\52C64B7E" "@C:\Windows\System32\Windows.UI.Immersive.dll,-38304"
  340. call :DelReg "HKU\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "My Pictures"
  341. call :DelReg "HKU\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" "My Pictures"
  342. call :DelReg "HKU\S-1-5-19\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" "My Pictures"
  343. call :DelReg "HKU\S-1-5-20\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" "My Pictures"
  344. call :DelRegClsIDForced "{24ad3ad4-a569-4530-98e1-ab02f9417aa8}"
  345. call :DelRegClsIDForced "{3ADD1653-EB32-4cb0-BBD7-DFA0ABB5ACCA}"
  346. call :DelRegForced "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{b3690e58-e961-423b-b687-386ebfd83239}"
  347. call :DelRegForced "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{b3690e58-e961-423b-b687-386ebfd83239}"
  348.  
  349.  
  350. REM *** Remove Videos (appears under This PC in File Explorer) ***
  351. call :DelReg "HKCR\SystemFileAssociations\MyVideo"
  352. call :DelReg "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "My Video"
  353. call :DelReg "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" "My Video"
  354. call :DelReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{292108be-88ab-4f33-9a26-7748e62e37ad}"
  355. call :DelReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{51294DA1-D7B1-485b-9E9A-17CFFE33E187}"
  356. call :DelReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{5fa96407-7e77-483c-ac93-691d05850de8}"
  357. call :DelReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{ea25fbd7-3bf7-409e-b97f-3352240903f4}"
  358. call :DelReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{f86fa3ab-70d2-4fc7-9c99-fcbf05467f3a}"
  359. call :DelReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "CommonVideo"
  360. call :DelReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" "CommonVideo"
  361. call :DelReg "HKU\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "My Video"
  362. call :DelReg "HKU\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" "My Video"
  363. call :DelReg "HKU\S-1-5-19\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" "My Video"
  364. call :DelReg "HKU\S-1-5-20\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" "My Video"
  365. call :DelRegClsIDForced "{A0953C92-50DC-43bf-BE83-3742FED03C9C}"
  366. call :DelRegClsIDForced "{f86fa3ab-70d2-4fc7-9c99-fcbf05467f3a}"
  367.  
  368.  
  369. REM *** Add 8 more accent colors ***
  370. call :DelReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Accents\0\Theme0" "Color" REG_DWORD "9538419"
  371. call :DelReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Accents\0\Theme1" "Color" REG_DWORD "10915422"
  372. call :DelReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Accents\1\Theme0" "Color" REG_DWORD "10766359"
  373. call :DelReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Accents\1\Theme1" "Color" REG_DWORD "10766359"
  374. call :DelReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Accents\2\Theme0" "Color" REG_DWORD "6392360"
  375. call :DelReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Accents\2\Theme1" "Color" REG_DWORD "12235947"
  376. call :DelReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Accents\3\Theme0" "Color" REG_DWORD "8764727"
  377. call :DelReg "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Accents\3\Theme1" "Color" REG_DWORD "8764727"
  378.  
  379.  
  380. REM *** Remove music/OneDrive/Pictures/Videos from DiskSnapshot ***
  381. call :DelReg "HKLM\SOFTWARE\Microsoft\DiskSnapshot\v2\0\.?users?*?music*"
  382. call :DelReg "HKLM\SOFTWARE\Microsoft\DiskSnapshot\v2\0\.?users?*?onedrive*"
  383. call :DelReg "HKLM\SOFTWARE\Microsoft\DiskSnapshot\v2\0\.?users?*?pictures*"
  384. call :DelReg "HKLM\SOFTWARE\Microsoft\DiskSnapshot\v2\0\.?users?*?videos*"
  385.  
  386.  
  387. REM *** Remove Pictures, Music, Videos from MUIcache ***
  388. call :DelReg "HKCU\SOFTWARE\Classes\Local Settings\MuiCache\1\52C64B7E" "@windows.storage.dll,-21790"
  389. call :DelReg "HKCU\SOFTWARE\Classes\Local Settings\MuiCache\1\52C64B7E" "@windows.storage.dll,-34584"
  390. call :DelReg "HKCU\SOFTWARE\Classes\Local Settings\MuiCache\1\52C64B7E" "@windows.storage.dll,-34595"
  391. call :DelReg "HKCU\SOFTWARE\Classes\Local Settings\MuiCache\1\52C64B7E" "@windows.storage.dll,-34620"
  392. call :DelReg "HKU\.DEFAULT\Software\Classes\Local Settings\MuiCache\1\52C64B7E" "@windows.storage.dll,-21790"
  393.  
  394.  
  395. REM *** Remove OneDrive ***
  396. call :DelRegClsID "{018D5C66-4533-4307-9B53-224DE2ED1FE6}"
  397. call :DelReg "HKLM\SOFTWARE\Policies\Microsoft\Windows\OneDrive" "DisableFileSyncNGSC" REG_DWORD 1
  398.  
  399.  
  400. REM *** Remove Retail Demo ***
  401. call :DelDirForced "%ProgramData%\Microsoft\Windows\RetailDemo"
  402. call :DelDirForced "%SystemRoot%\SystemApps\Microsoft.Windows.CloudExperienceHost_cw5n1h2txyewy\RetailDemo"
  403.  
  404.  
  405. REM *** Remove Logon screen wallpaper/background. Will use solid color instead (Accent color) ***
  406. call :AddReg "HKLM\SOFTWARE\Policies\Microsoft\Windows\System" "DisableLogonBackgroundImage" REG_DWORD 1
  407.  
  408.  
  409. REM *** Always show all icons on the taskbar (next to clock) ***
  410. REM 0 = Show all icons
  411. REM 1 = Hide icons on the taskbar
  412. call :AddReg "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer" "EnableAutoTray" REG_DWORD 0
  413.  
  414.  
  415. REM *** Show hidden files in Explorer ***
  416. call :AddReg "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "Hidden" REG_DWORD 1
  417.  
  418.  
  419. REM *** Show super hidden system files in Explorer ***
  420. call :AddReg "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "ShowSuperHidden" REG_DWORD 1
  421.  
  422.  
  423. REM *** Show file extensions in Explorer ***
  424. REM 0 = extensions are visible
  425. REM 1 = extensions are hidden
  426. call :AddReg "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "HideFileExt" REG_DWORD 0
  427.  
  428.  
  429. rem *** Show super-duper hidden extensions [basically deleting the NeverShowExt (REG_SZ) values] ***
  430. REM Source: www.askvg.com/tip-how-to-show-file-extensions-of-shortcuts-lnk-url-pif-in-windows-explorer/
  431. REM .LNK (File/Folder Shortcut)
  432. REM .URL (Internet Shortcut)
  433. REM .PIF (MS-DOS Program Shortcut)
  434. REM .SCF (Windows Explorer Command)
  435. REM .SHS (Shell Scrap Object)
  436. REM .SHB (Document Shortcut)
  437. REM .library-ms (Library folder)
  438. call :DelReg "HKCR\lnkfile" "NeverShowExt"
  439. call :DelReg "HKCR\IE.AssocFile.URL" "NeverShowExt"
  440. call :DelReg "HKCR\IE.AssocFile.WEBSITE" "NeverShowExt"
  441. call :DelReg "HKCR\InternetShortcut" "NeverShowExt"
  442. call :DelReg "HKCR\Microsoft.Website" "NeverShowExt"
  443. call :DelReg "HKCR\piffile" "NeverShowExt"
  444. call :DelReg "HKCR\SHCmdFile" "NeverShowExt"
  445. call :DelReg "HKCR\LibraryFolder" "NeverShowExt"
  446.  
  447.  
  448. REM *** An oldy, but a goody. Adding the following value to the registry will prevent both Windows and Office from creating LNK files in the Recents folder on your C drive. Especially recommended if your OS is installed on an SSD.***
  449. REM *** Need to check if this also works with Office 2007/2010/2013 running on Win10
  450. call :AddReg "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" "NoRecentDocsHistory" REG_DWORD 1
  451.  
  452.  
  453. REM *** Show NTFS files compressed in a different color in Explorer ***
  454. REM 0 = Black (same as non-compressed files)
  455. REM 1 = Blue [default]
  456. call :AddReg "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "ShowCompColor" REG_DWORD 1
  457.  
  458.  
  459. REM *** Expand to current folder in the left panel in Explorer ***
  460. REM 0 = Don't expand
  461. REM 1 = Expand
  462. call :AddReg "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "NavPaneExpandToCurrentFolder" REG_DWORD 1
  463.  
  464.  
  465. REM *** Disable WiFi Sense (shares your WiFi network login with other people) ***
  466. call :AddReg "HKLM\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots" "value" REG_DWORD 0
  467. call :AddReg "HKLM\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" "value" REG_DWORD 0
  468.  
  469.  
  470. REM *** Disable Superfetch (A must for SSD drives, but good to do in general) ***
  471. REM Disabling this service prevents further creation of PF files in C:\Windows\Prefetch.
  472. REM After disabling this service, it is completely safe to delete everything in that folder, except for the ReadyBoot folder.
  473. sc config SysMain start= disabled
  474. call :AddReg "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters" "EnableSuperfetch" REG_DWORD 0
  475. call :AddReg "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters" "EnablePrefetcher" REG_DWORD 0
  476.  
  477.  
  478. REM *** Add the option "Processor performance core parking min cores" ***
  479. REM *** Option will be added to: Power Options > High Performance > Change Plan Settings > Change advanced power settings > Processor power management
  480. REM *** Default data is 1 (option hidden).
  481. call :AddReg "HKLM\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\54533251-82be-4824-96c1-47b60b740d00\0cc5b647-c1df-4637-891a-dec35c318583" "Attributes" REG_DWORD 0
  482.  
  483.  
  484. REM *** Disable CPU Core Parking ***
  485. REM *** Default value is 100 decimal.
  486. REM Basically "Core parking" means that the OS can use less CPU cores when they're not needed, thus saving power.
  487. REM This, however, can somewhat hamper performance, so advanced users prefer to disable this feature.
  488. REM Better to do this on a desktop. If you’re using a laptop and battery life is important to you - don't change this.
  489. REM source: https://bitsum.com/parkcontrol/
  490. call :AddReg "HKLM\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\54533251-82be-4824-96c1-47b60b740d00\0cc5b647-c1df-4637-891a-dec35c318583" "ValueMax" REG_DWORD 0
  491.  
  492.  
  493. REM *** SERVICES tweaks ***
  494. for %%i in (
  495.   DiagTrack
  496.   diagnosticshub.standardcollector.service
  497.   dmwappushservice
  498.   RemoteRegistry
  499.   TrkWks
  500.   WMPNetworkSvc
  501.   WSearch
  502.  
  503. ) do (
  504.   sc config %%i start= disabled
  505.   sc stop %%i
  506. )
  507.  
  508.  
  509. REM *** SCHEDULED TASKS tweaks ***
  510. REM "Microsoft\Windows\CloudExperienceHost\CreateObjectTask"
  511. REM "Microsoft\Windows\DiskFootprint\Diagnostics" *** Not sure if should be disabled, maybe related to S.M.A.R.T.
  512. REM The task Microsoft\Windows\SettingSync\BackgroundUploadTask can be disabled using a simple bit change. I use a REG file for that. Reg key is different for each machine/edition!
  513. for %%i in (
  514.   "Microsoft\Windows\AppID\SmartScreenSpecific"
  515.   "Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser"
  516.   "Microsoft\Windows\Application Experience\ProgramDataUpdater"
  517.   "Microsoft\Windows\Application Experience\StartupAppTask"
  518.   "Microsoft\Windows\Autochk\Proxy"
  519.   "Microsoft\Windows\Customer Experience Improvement Program\Consolidator"
  520.   "Microsoft\Windows\Customer Experience Improvement Program\KernelCeipTask"
  521.   "Microsoft\Windows\Customer Experience Improvement Program\UsbCeip"
  522.   "Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector"
  523.   "Microsoft\Windows\FileHistory\File History (maintenance mode)"
  524.   "Microsoft\Windows\Maintenance\WinSAT"
  525.   "Microsoft\Windows\NetTrace\GatherNetworkInfo"
  526.   "Microsoft\Windows\PI\Sqm-Tasks"
  527.   "Microsoft\Windows\Time Synchronization\ForceSynchronizeTime"
  528.   "Microsoft\Windows\Time Synchronization\SynchronizeTime"
  529.   "Microsoft\Windows\Windows Error Reporting\QueueReporting"
  530.   "Microsoft\Windows\WindowsUpdate\Automatic App Update"
  531.  
  532. ) do SchTasks /Change /TN %%i /DISABLE
  533.  
  534. for %%j in (
  535.   "DiagTrack"
  536.   "Microsoft-OneCore-AllowTelemetry"
  537.   "Microsoft-OneCore-AppRuntime-WOW64-xbox"
  538.   "Microsoft-OneCore-AppRuntime-xbox"
  539.   "Microsoft-OneCore-Networking-XboxLive"
  540.   "Microsoft-OneCore-TroubleShooting"
  541.   "Microsoft-Windows-Client-Drivers-xbox"
  542.   "Microsoft-Windows-Client-Features-Package-AutoMerged-xbox"
  543.   "Microsoft-Windows-Client-Features-WOW64-Package-AutoMerged-xbox"
  544.   "Microsoft-Windows-Cortana"
  545.   "Microsoft-Windows-InternetExplorer-Optional-Package"
  546.   "Microsoft-Windows-OneDrive"
  547.   "Microsoft-Windows-Search2"
  548.   "Microsoft-Xbox"
  549.   "Telemetry"
  550.   "Windows-Defender"
  551.  
  552. ) do for /f "tokens=4,*" %%i in ('DISM /Online /Get-Packages ^| find %%j') do DISM /Online /Remove-Package /PackageName:%%i /NoRestart
  553.  
  554.  
  555. REM *** Remove XAML (Modern) apps using DISM ***
  556. for %%i in (
  557.   Microsoft.3DBuilder
  558.   Microsoft.BingFinance
  559.   Microsoft.BingNews
  560.   Microsoft.Getstarted
  561.   Microsoft.MicrosoftOfficeHub
  562.   Microsoft.MicrosoftSolitaireCollection
  563.   Microsoft.Office.OneNote
  564.   Microsoft.SkypeApp
  565.   Microsoft.WindowsPhone
  566.   Microsoft.XboxApp
  567.   Microsoft.ZuneMusic
  568.   Microsoft.ZuneVideo
  569.  
  570. ) do powershell (Get-AppxProvisionedPackage -Online ^| Where-Object DisplayName -eq %%i ^| Remove-AppxProvisionedPackage -Online)
  571.  
  572.  
  573. REM Now would be a good time to reboot, so all those tweaks take effect.
  574. REM Using IE11, go to this URL: https://choice.microsoft.com/en-us/opt-out#
  575. REM Set "Personalized ads in this browser" to Off.
  576. REM This online setting doesn't seem to work with Edge (Edge is pre-disabled in Enterprise LTSB).
  577.  
  578. REM The developer mode may be greyed-out, since we set it through GPEDIT
  579. REM Go to: Control Panel ->Update & Security -> For Developers -> Select "Developer Mode".
  580. REM Go to: Control Panel ->Privacy. Go through each setting on the left and turn off everything you don't need (too many to list here).
  581. REM Run Windows Update and install all the latest updates. Reboot if necessary.
  582. REM *** Reduce the size of your patched Windows OS (final step before imaging) ***
  583.  
  584. REM All installed updates will be permanent and cannot be uninstalled after running this command
  585. Dism /online /Cleanup-Image /StartComponentCleanup /ResetBase
  586.  
  587.  
  588. REM *** Ban Skype advertisement ****
  589. set HOSTS=%WINDIR%\system32\drivers\etc\hosts
  590. for %%i in (
  591.   "rad.msn.com"
  592.   "apps.skype.com"
  593.  
  594. ) do findstr /i %%i %HOSTS% > nul 2> nul || echo %NoIP% %%~i >> %HOSTS%
  595.  
  596.  
  597. exit /b
  598.  
  599.  
  600. :DelDirForced
  601.   if not [%1]==[] if exist %1 (
  602.     takeown /f %1 /r /d y
  603.     icacls %1 /grant %AdminsGroup%:F /T
  604.     rd /s /q %1
  605.   )
  606. exit /b
  607.  
  608. :GetRegAccess
  609.   %SetACL% -on %1 -ot reg -actn setowner -ownr "n:%AdminsGroup%" -rec yes
  610.   %SetACL% -on %1 -ot reg -actn ace -ace "n:%AdminsGroup%;p:full" -rec yes
  611. exit /b
  612.  
  613. :AddReg
  614.   if not [%4]==[] (
  615.     reg add %1 /v %2 /t %~3 /d %4 /f /reg:32
  616.     reg add %1 /v %2 /t %~3 /d %4 /f /reg:64
  617.   ) else if not [%3]==[]  (
  618.     reg add %1 /ve   /t %~2 /d %3 /f /reg:32
  619.     reg add %1 /ve   /t %~2 /d %3 /f /reg:64
  620.   ) else (
  621.     reg add %1 /f /reg:32
  622.     reg add %1 /f /reg:64
  623.   )
  624. exit /b
  625.  
  626. :AddRegForced
  627.   call :GetRegAccess %1
  628.   if not [%4]==[] (
  629.     reg add %1 /v %2 /t %~3 /d %4 /f
  630.   ) else if not [%3]==[]  (
  631.     reg add %1 /ve   /t %~2 /d %3 /f
  632.   ) else (
  633.     reg add %1 /f
  634.   )
  635. exit /b
  636.  
  637. :DelReg
  638.   if not [%2]==[] (
  639.     reg delete %1 /v %2 /f /reg:32
  640.     reg delete %1 /v %2 /f /reg:64
  641.   ) else (
  642.     reg delete %1 /f /reg:32
  643.     reg delete %1 /f /reg:64
  644.   )
  645. exit /b
  646.  
  647. :DelRegForced
  648.   call :GetRegAccess %1
  649.   if not [%2]==[] (
  650.     reg delete %1 /v %2 /f
  651.   ) else (
  652.     reg delete %1 /f
  653.   )
  654. exit /b
  655.  
  656. :DelRegClsID
  657.   if not [%1]==[] (
  658.     reg delete "HKCU\SOFTWARE\Classes\CLSID\%~1" /f /reg:32
  659.     reg delete "HKCU\SOFTWARE\Classes\CLSID\%~1" /f /reg:64
  660.     reg delete "HKLM\SOFTWARE\Classes\CLSID\%~1" /f /reg:32
  661.     reg delete "HKLM\SOFTWARE\Classes\CLSID\%~1" /f /reg:64
  662.   )
  663. exit /b
  664.  
  665. :DelRegClsIDForced
  666.   if not [%1]==[] (
  667.     call :GetRegAccess "HKCU\SOFTWARE\Classes\CLSID\%~1"
  668.     call :GetRegAccess "HKLM\SOFTWARE\Classes\CLSID\%~1"
  669.     call :GetRegAccess "HKCU\SOFTWARE\Wow6432Node\Classes\CLSID\%~1"
  670.     call :GetRegAccess "HKLM\SOFTWARE\Wow6432Node\Classes\CLSID\%~1"
  671.     reg delete "HKCU\SOFTWARE\Classes\CLSID\%~1" /f
  672.     reg delete "HKLM\SOFTWARE\Classes\CLSID\%~1" /f
  673.     reg delete "HKCU\SOFTWARE\Wow6432Node\Classes\CLSID\%~1" /f
  674.     reg delete "HKLM\SOFTWARE\Wow6432Node\Classes\CLSID\%~1" /f
  675.   )
  676. exit /b
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement