Windows Desktop Optimization.bat

界面:

 

github: https://github.com/m2nlight/WindowsDesktopOptimization

  • Config Service

    • [Disabled] Windows Update
    • [Disabled] Windows Search
    • [Manual] Update Orchestrator Service for Windows Update
    • [Manual] Superfetch
    • [Disabled] Network Connected Devices Auto-Setup
    • [Disabled] Microsoft Windows SMS Router Service
    • [Disabled] HomeGroup Provider Server
    • [Disabled] HomeGroup Listener Server
    • [Manual] Function Discovery Resource Publication
    • [Manual] Function Discovery Provider Host
  • Config Registry and GroupPolicy

    • Disable UAC (* REBOOT)
    • Disable TCP Auto-Tuning
    • Hide This PC 7 folders (* RESTART EXPLORER)
    • Show extensions for known file types
    • Open File Explorer to This PC
    • Hide recently used files in Quick access
    • Hide frequently used files in Quick access
    • Hide Recycle bin on Desktop
    • Pin Recycle bin to Quick access
    • Pin GodMode control panel to Quick access
    • Disable Windows Feedback
    • Disable Application Experience task schedulers
    • Disable Customer Experience Improvement Program task schedulers
  • Config Appx (for other win10 version)

    • Nothing to do.
    • Remove XBox
    • Remove Zune
    • Remove Bing

 

 

 

 

Windows Desktop Optimization.bat

  1 @echo off
  2 pushd %~dp0
  3 set currentuser=%username%
  4 rem UAC code begin
  5 set getadminfile="%temp%\getadmin.vbs"
  6 echo Windows Desktop Optimization
  7 echo ============================
  8 echo Starting
  9 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\SYSTEM" >nul 2>nul
 10 if %ERRORLEVEL% EQU 0 (
 11     goto :Admin
 12 ) else (
 13     if %ERRORLEVEL% EQU 2 (
 14         goto :PathErr
 15     ) else (
 16         goto :UAC
 17     )
 18 )
 19 :PathErr
 20 echo.
 21 echo Please open "%~n0%~x0" by explorer.exe
 22 echo.
 23 echo Press any key to explore the folder...
 24 pause>nul
 25 start "" "%SYSTEMROOT%\system32\explorer.exe" /select,"%~f0"
 26 goto :END
 27 :UAC
 28 echo Set sh = CreateObject^("Shell.Application"^) > %getadminfile%
 29 echo sh.ShellExecute "%~f0", "", "", "runas", 1 >> %getadminfile%
 30 ping 127.1 -n 1 >nul
 31 "%SYSTEMROOT%\system32\cscript.exe" %getadminfile%
 32 goto :END
 33 :Admin
 34 if exist %getadminfile% ( del %getadminfile% )
 35 cls
 36 rem UAC code end
 37 echo Windows Desktop Optimization
 38 echo ============================
 39 ::PowerShell /Command "&{Get-WmiObject -Class Win32_OperatingSystem | Select-Object -ExpandProperty Caption}"
 40 set caption=
 41 for /f "skip=1 delims=" %%t in ('wmic os get caption') do (
 42 if not defined caption set caption=%%t
 43 )
 44 echo %caption%
 45 echo Current Domain: %USERDOMAIN%
 46 echo Current User: %currentuser%
 47 echo.
 48 set /p tmpInput=Are you ready? (Y/N):
 49 if /i "%tmpInput%"=="y" goto :START
 50 echo Canelled.
 51 echo Press any key to exit...
 52 pause>nul
 53 goto :END
 54 :START
 55 echo (1/3) Config Service
 56 echo - [Disabled] Windows Update
 57 call :disableService wuauserv
 58 echo - [Disabled] Windows Search
 59 call :disableService WSearch
 60 echo - [Manual] Update Orchestrator Service for Windows Update
 61 call :manualService UsoSvc
 62 echo - [Manual] Superfetch
 63 call :manualService SysMain
 64 ::echo - [Disabled] Security Center
 65 ::call :disableService wscsvc
 66 echo - [Disabled] Network Connected Devices Auto-Setup
 67 call :disableService NcdAutoSetup
 68 echo - [Disabled] Microsoft Windows SMS Router Service
 69 call :disableService SmsRouter
 70 echo - [Disabled] HomeGroup Provider Server
 71 call :disableService HomeGroupProvider
 72 echo - [Disabled] HomeGroup Listener Server
 73 call :disableService HomeGroupListener
 74 echo - [Manual] Function Discovery Resource Publication
 75 call :manualService FDResPub
 76 echo - [Manual] Function Discovery Provider Host
 77 call :manualService fdPHost
 78 echo (2/3) Config Registry And Settings
 79 echo - Disable UAC (* REBOOT)
 80 reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "EnableLUA" /t REG_DWORD /d 0x0 /f>nul
 81 ::echo - Disable Windows Defender
 82 ::reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender" /v "DisableAntiSpyware" /t REG_DWORD /d 0x1 /f>nul
 83 echo - Disable TCP Auto-Tuning
 84 netsh interface tcp set heuristics disabled>nul
 85 echo - Hide This PC 7 folders (* RESTART EXPLORER)
 86 rem 3D Objects
 87 reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag" /v "ThisPCPolicy" /t REG_SZ /d "Hide" /f>nul 2>nul
 88 rem Desktop
 89 reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}\PropertyBag" /v "ThisPCPolicy" /t REG_SZ /d "Hide" /f>nul 2>nul
 90 rem Documents
 91 reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{f42ee2d3-909f-4907-8871-4c22fc0bf756}\PropertyBag" /v "ThisPCPolicy" /t REG_SZ /d "Hide" /f>nul 2>nul
 92 rem Downloads
 93 reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{7d83ee9b-2244-4e70-b1f5-5393042af1e4}\PropertyBag" /v "ThisPCPolicy" /t REG_SZ /d "Hide" /f>nul 2>nul
 94 rem Music
 95 reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{a0c69a99-21c8-4671-8703-7934162fcf1d}\PropertyBag" /v "ThisPCPolicy" /t REG_SZ /d "Hide" /f>nul 2>nul
 96 rem Pictures
 97 reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{0ddd015d-b06c-45d5-8c4c-f59713854639}\PropertyBag" /v "ThisPCPolicy" /t REG_SZ /d "Hide" /f>nul 2>nul
 98 rem Videos
 99 reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{35286a68-3c57-41a1-bbb1-0eae73d76c95}\PropertyBag" /v "ThisPCPolicy" /t REG_SZ /d "Hide" /f>nul 2>nul
100 echo - Show extensions for known file types
101 reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "HideFileExt" /t REG_DWORD /d 0x0 /f>nul
102 echo - Open File Explorer to This PC
103 reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "LaunchTo" /t REG_DWORD /d 0x1 /f>nul
104 echo - Hide recently used files in Quick access
105 reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" /v "ShowRecent" /t REG_DWORD /d 0x0 /f>nul
106 echo - Hide frequently used files in Quick access
107 reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" /v "ShowFrequent" /t REG_DWORD /d 0x0 /f>nul
108 echo - Hide Recycle bin on Desktop
109 reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v "{645FF040-5081-101B-9F08-00AA002F954E}" /t REG_DWORD /d 0x1 /f>nul
110 reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" /v "{645FF040-5081-101B-9F08-00AA002F954E}" /t REG_DWORD /d 0x1 /f>nul
111 ::echo - Show Recycle bin on This PC
112 ::reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{645FF040-5081-101B-9F08-00AA002F954E}" /f>nul
113 ::rem reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{645FF040-5081-101B-9F08-00AA002F954E}" /f>nul 2>nul
114 echo - Pin Recycle bin to Quick access
115 call :pintohomeCLSID {645FF040-5081-101B-9F08-00AA002F954E}
116 ::echo - Pin GodMode control panel to Quick access
117 ::call :pintohomeDir "Control Panel (GodMode).{ED7BA470-8E54-465E-825C-99712043E01C}"
118 echo - Disable Windows Feedback
119 reg add "HKCU\Software\Microsoft\Siuf\Rules" /v "NumberOfSIUFInPeriod" /t REG_DWORD /d 0x0 /f>nul
120 reg add "HKCU\Software\Microsoft\Siuf\Rules" /v "PeriodInNanoSeconds" /t REG_DWORD /d 0x0 /f>nul
121 echo - Disable Application Experience task schedulers
122 schtasks /change /tn "\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" /disable>nul 2>nul
123 schtasks /change /tn "\Microsoft\Windows\Application Experience\ProgramDataUpdater" /disable>nul 2>nul
124 schtasks /change /tn "\Microsoft\Windows\Application Experience\StartupAppTask" /disable>nul 2>nul
125 echo - Disable Customer Experience Improvement Program task schedulers
126 schtasks /change /tn "\Microsoft\Windows\Customer Experience Improvement Program\Consolidator" /disable>nul 2>nul
127 schtasks /change /tn "\Microsoft\Windows\Customer Experience Improvement Program\KernelCeipTask" /disable>nul 2>nul
128 schtasks /change /tn "\Microsoft\Windows\Customer Experience Improvement Program\UsbCeip" /disable>nul 2>nul
129 echo (3/3) Config Appx
130 echo - Nothing to do.
131 ::echo - Remove XBox
132 ::call :removeAppx *xbox*
133 ::echo - Remove Zune
134 ::call :removeAppx *zune*
135 ::echo - Remove Bing
136 ::call :removeAppx *bing*
137 echo.
138 echo Press any key to EXIT...
139 pause>nul
140 goto :END
141 :pintohomeCLSID
142 reg add "HKCR\CLSID\%1\shell\pintohome" /v "MUIVerb" /t REG_SZ /d "@shell32.dll,-51377" /f>nul
143 reg add "HKCR\CLSID\%1\shell\pintohome\command" /v "DelegateExecute" /t REG_SZ /d "{b455f46e-e4af-4035-b0a4-cf18d2f6f28e}" /f>nul
144 PowerShell /Command "&{$o=New-Object -ComObject shell.application;$o.Namespace('shell:::%1').Self.InvokeVerb('pintohome')}">nul
145 reg delete "HKCR\CLSID\%1\shell\pintohome" /f>nul
146 goto :eof
147 :pintohomeDir
148 set tmpDir=%userprofile%\Desktop\%~1
149 md "%tmpDir%">nul
150 PowerShell /Command "&{$o=New-Object -ComObject shell.application;$o.Namespace('%tmpDir%').Self.InvokeVerb('pintohome')}">nul
151 rd /q "%tmpDir%">nul
152 goto :eof
153 :disableService
154 call :configService %1 4 null stop
155 goto :eof
156 :manualService
157 call :configService %1 3 null stop
158 goto :eof
159 :configService
160 ::%1 is service name (not DisplayName)
161 ::%2 is startup type (2-Automatic, 3-Manual, 4-Disabled)
162 ::%3 is DelayedAutostart (1-Enabled, 0-Disable, null-skip)
163 ::%4 is net command (start, stop, null-skip)
164 set serviceName=%~1
165 if "%serviceName%"=="" goto :eof
166 if "%2"=="" goto :eof
167 set regKey="HKLM\SYSTEM\CurrentControlSet\services\%serviceName%"
168 reg query %regKey% /v Start>nul 2>nul
169 if ERRORLEVEL 1 goto :eof
170 reg add %regKey% /v Start /t REG_DWORD /d %2 /f>nul
171 if "%3"=="" goto :eof
172 if /i %3==null goto :eof
173 reg add %regKey% /v DelayedAutostart /t REG_DWORD /d %3 /f>nul
174 if "%4"=="" goto :eof
175 if /i %4==null goto :eof
176 net %4 %serviceName%>nul
177 goto :eof
178 :removeAppx
179 if "%1"=="" goto :eof
180 PowerShell /Command "&{Get-AppxPackage %1 | Remove-AppxPackage}">nul
181 ::%1 filter
182 goto :eof
183 :END
184 if exist %getadminfile% ( del %getadminfile% )
185 popd

 

转载于:https://www.cnblogs.com/Bob-wei/p/7514211.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值