博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Windows Desktop Optimization.bat
阅读量:4582 次
发布时间:2019-06-09

本文共 10239 字,大约阅读时间需要 34 分钟。

界面:

 

github:

  • 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>nul100 echo - Show extensions for known file types101 reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "HideFileExt" /t REG_DWORD /d 0x0 /f>nul102 echo - Open File Explorer to This PC103 reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "LaunchTo" /t REG_DWORD /d 0x1 /f>nul104 echo - Hide recently used files in Quick access105 reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" /v "ShowRecent" /t REG_DWORD /d 0x0 /f>nul106 echo - Hide frequently used files in Quick access107 reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" /v "ShowFrequent" /t REG_DWORD /d 0x0 /f>nul108 echo - Hide Recycle bin on Desktop109 reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v "{645FF040-5081-101B-9F08-00AA002F954E}" /t REG_DWORD /d 0x1 /f>nul110 reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" /v "{645FF040-5081-101B-9F08-00AA002F954E}" /t REG_DWORD /d 0x1 /f>nul111 ::echo - Show Recycle bin on This PC112 ::reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{645FF040-5081-101B-9F08-00AA002F954E}" /f>nul113 ::rem reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{645FF040-5081-101B-9F08-00AA002F954E}" /f>nul 2>nul114 echo - Pin Recycle bin to Quick access115 call :pintohomeCLSID {645FF040-5081-101B-9F08-00AA002F954E}116 ::echo - Pin GodMode control panel to Quick access117 ::call :pintohomeDir "Control Panel (GodMode).{ED7BA470-8E54-465E-825C-99712043E01C}"118 echo - Disable Windows Feedback119 reg add "HKCU\Software\Microsoft\Siuf\Rules" /v "NumberOfSIUFInPeriod" /t REG_DWORD /d 0x0 /f>nul120 reg add "HKCU\Software\Microsoft\Siuf\Rules" /v "PeriodInNanoSeconds" /t REG_DWORD /d 0x0 /f>nul121 echo - Disable Application Experience task schedulers122 schtasks /change /tn "\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" /disable>nul 2>nul123 schtasks /change /tn "\Microsoft\Windows\Application Experience\ProgramDataUpdater" /disable>nul 2>nul124 schtasks /change /tn "\Microsoft\Windows\Application Experience\StartupAppTask" /disable>nul 2>nul125 echo - Disable Customer Experience Improvement Program task schedulers126 schtasks /change /tn "\Microsoft\Windows\Customer Experience Improvement Program\Consolidator" /disable>nul 2>nul127 schtasks /change /tn "\Microsoft\Windows\Customer Experience Improvement Program\KernelCeipTask" /disable>nul 2>nul128 schtasks /change /tn "\Microsoft\Windows\Customer Experience Improvement Program\UsbCeip" /disable>nul 2>nul129 echo (3/3) Config Appx130 echo - Nothing to do.131 ::echo - Remove XBox132 ::call :removeAppx *xbox*133 ::echo - Remove Zune134 ::call :removeAppx *zune*135 ::echo - Remove Bing136 ::call :removeAppx *bing*137 echo.138 echo Press any key to EXIT...139 pause>nul140 goto :END141 :pintohomeCLSID142 reg add "HKCR\CLSID\%1\shell\pintohome" /v "MUIVerb" /t REG_SZ /d "@shell32.dll,-51377" /f>nul143 reg add "HKCR\CLSID\%1\shell\pintohome\command" /v "DelegateExecute" /t REG_SZ /d "{b455f46e-e4af-4035-b0a4-cf18d2f6f28e}" /f>nul144 PowerShell /Command "&{$o=New-Object -ComObject shell.application;$o.Namespace('shell:::%1').Self.InvokeVerb('pintohome')}">nul145 reg delete "HKCR\CLSID\%1\shell\pintohome" /f>nul146 goto :eof147 :pintohomeDir148 set tmpDir=%userprofile%\Desktop\%~1149 md "%tmpDir%">nul150 PowerShell /Command "&{$o=New-Object -ComObject shell.application;$o.Namespace('%tmpDir%').Self.InvokeVerb('pintohome')}">nul151 rd /q "%tmpDir%">nul152 goto :eof153 :disableService154 call :configService %1 4 null stop155 goto :eof156 :manualService157 call :configService %1 3 null stop158 goto :eof159 :configService160 ::%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=%~1165 if "%serviceName%"=="" goto :eof166 if "%2"=="" goto :eof167 set regKey="HKLM\SYSTEM\CurrentControlSet\services\%serviceName%"168 reg query %regKey% /v Start>nul 2>nul169 if ERRORLEVEL 1 goto :eof170 reg add %regKey% /v Start /t REG_DWORD /d %2 /f>nul171 if "%3"=="" goto :eof172 if /i %3==null goto :eof173 reg add %regKey% /v DelayedAutostart /t REG_DWORD /d %3 /f>nul174 if "%4"=="" goto :eof175 if /i %4==null goto :eof176 net %4 %serviceName%>nul177 goto :eof178 :removeAppx179 if "%1"=="" goto :eof180 PowerShell /Command "&{Get-AppxPackage %1 | Remove-AppxPackage}">nul181 ::%1 filter182 goto :eof183 :END184 if exist %getadminfile% ( del %getadminfile% )185 popd

 

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

你可能感兴趣的文章
|待研究|委托付款的支付状态触发器
查看>>
redis集群中的主从复制架构(3主3从)
查看>>
初始Linux(其实之前接触过(*^__^*) 嘻嘻……)
查看>>
一些多项式的整理
查看>>
NIO selector
查看>>
MySQL中DATETIME、DATE和TIMESTAMP类型的区别
查看>>
asp代码获取年数,季度数.星期数,天数,小时数,分钟数,秒数等时
查看>>
python之建完model之后操作admin
查看>>
Java 类加载机制 ClassLoader Class.forName 内存管理 垃圾回收GC
查看>>
shell 脚本后台运行知识
查看>>
php设置cookie,在js中如何获取
查看>>
实验三+099+吴丹丹
查看>>
[bzoj3036]绿豆蛙的归宿
查看>>
[洛谷P5057][CQOI2006]简单题
查看>>
多线程同步的几种方法
查看>>
数据结构-冒泡排序
查看>>
关于程序状态字寄存器PSW(Program Status Word)与多核多线程
查看>>
mybatis的缓存
查看>>
java 缓冲流 Buffer
查看>>
7月23号=》261页-265页
查看>>