• 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%system32cacls.exe" "%SYSTEMROOT%system32configSYSTEM" >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%system32explorer.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%system32cscript.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 "HKLMSOFTWAREMicrosoftWindowsCurrentVersionPoliciesSystem" /v "EnableLUA" /t REG_DWORD /d 0x0 /f>nul
     81 ::echo - Disable Windows Defender
     82 ::reg add "HKLMSOFTWAREPoliciesMicrosoftWindows 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 "HKLMSOFTWAREMicrosoftWindowsCurrentVersionExplorerFolderDescriptions{31C0DD25-9439-4F12-BF41-7FF4EDA38722}PropertyBag" /v "ThisPCPolicy" /t REG_SZ /d "Hide" /f>nul 2>nul
     88 rem Desktop
     89 reg add "HKLMSOFTWAREMicrosoftWindowsCurrentVersionExplorerFolderDescriptions{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}PropertyBag" /v "ThisPCPolicy" /t REG_SZ /d "Hide" /f>nul 2>nul
     90 rem Documents
     91 reg add "HKLMSOFTWAREMicrosoftWindowsCurrentVersionExplorerFolderDescriptions{f42ee2d3-909f-4907-8871-4c22fc0bf756}PropertyBag" /v "ThisPCPolicy" /t REG_SZ /d "Hide" /f>nul 2>nul
     92 rem Downloads
     93 reg add "HKLMSOFTWAREMicrosoftWindowsCurrentVersionExplorerFolderDescriptions{7d83ee9b-2244-4e70-b1f5-5393042af1e4}PropertyBag" /v "ThisPCPolicy" /t REG_SZ /d "Hide" /f>nul 2>nul
     94 rem Music
     95 reg add "HKLMSOFTWAREMicrosoftWindowsCurrentVersionExplorerFolderDescriptions{a0c69a99-21c8-4671-8703-7934162fcf1d}PropertyBag" /v "ThisPCPolicy" /t REG_SZ /d "Hide" /f>nul 2>nul
     96 rem Pictures
     97 reg add "HKLMSOFTWAREMicrosoftWindowsCurrentVersionExplorerFolderDescriptions{0ddd015d-b06c-45d5-8c4c-f59713854639}PropertyBag" /v "ThisPCPolicy" /t REG_SZ /d "Hide" /f>nul 2>nul
     98 rem Videos
     99 reg add "HKLMSOFTWAREMicrosoftWindowsCurrentVersionExplorerFolderDescriptions{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 "HKCUSOFTWAREMicrosoftWindowsCurrentVersionExplorerAdvanced" /v "HideFileExt" /t REG_DWORD /d 0x0 /f>nul
    102 echo - Open File Explorer to This PC
    103 reg add "HKCUSOFTWAREMicrosoftWindowsCurrentVersionExplorerAdvanced" /v "LaunchTo" /t REG_DWORD /d 0x1 /f>nul
    104 echo - Hide recently used files in Quick access
    105 reg add "HKCUSOFTWAREMicrosoftWindowsCurrentVersionExplorer" /v "ShowRecent" /t REG_DWORD /d 0x0 /f>nul
    106 echo - Hide frequently used files in Quick access
    107 reg add "HKCUSOFTWAREMicrosoftWindowsCurrentVersionExplorer" /v "ShowFrequent" /t REG_DWORD /d 0x0 /f>nul
    108 echo - Hide Recycle bin on Desktop
    109 reg add "HKCUSOFTWAREMicrosoftWindowsCurrentVersionExplorerHideDesktopIconsNewStartPanel" /v "{645FF040-5081-101B-9F08-00AA002F954E}" /t REG_DWORD /d 0x1 /f>nul
    110 reg add "HKCUSOFTWAREMicrosoftWindowsCurrentVersionExplorerHideDesktopIconsClassicStartMenu" /v "{645FF040-5081-101B-9F08-00AA002F954E}" /t REG_DWORD /d 0x1 /f>nul
    111 ::echo - Show Recycle bin on This PC
    112 ::reg add "HKLMSOFTWAREMicrosoftWindowsCurrentVersionExplorerMyComputerNameSpace{645FF040-5081-101B-9F08-00AA002F954E}" /f>nul
    113 ::rem reg delete "HKLMSOFTWAREMicrosoftWindowsCurrentVersionExplorerMyComputerNameSpace{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 "HKCUSoftwareMicrosoftSiufRules" /v "NumberOfSIUFInPeriod" /t REG_DWORD /d 0x0 /f>nul
    120 reg add "HKCUSoftwareMicrosoftSiufRules" /v "PeriodInNanoSeconds" /t REG_DWORD /d 0x0 /f>nul
    121 echo - Disable Application Experience task schedulers
    122 schtasks /change /tn "MicrosoftWindowsApplication ExperienceMicrosoft Compatibility Appraiser" /disable>nul 2>nul
    123 schtasks /change /tn "MicrosoftWindowsApplication ExperienceProgramDataUpdater" /disable>nul 2>nul
    124 schtasks /change /tn "MicrosoftWindowsApplication ExperienceStartupAppTask" /disable>nul 2>nul
    125 echo - Disable Customer Experience Improvement Program task schedulers
    126 schtasks /change /tn "MicrosoftWindowsCustomer Experience Improvement ProgramConsolidator" /disable>nul 2>nul
    127 schtasks /change /tn "MicrosoftWindowsCustomer Experience Improvement ProgramKernelCeipTask" /disable>nul 2>nul
    128 schtasks /change /tn "MicrosoftWindowsCustomer Experience Improvement ProgramUsbCeip" /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 "HKCRCLSID\%1shellpintohome" /v "MUIVerb" /t REG_SZ /d "@shell32.dll,-51377" /f>nul
    143 reg add "HKCRCLSID\%1shellpintohomecommand" /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 "HKCRCLSID\%1shellpintohome" /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="HKLMSYSTEMCurrentControlSetservices\%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
  • 相关阅读:
    201521044091《Java程序设计》第7周学习总结
    201521044091《java程序设计》第四次总结
    201521044091 《java程序设计》第八周学习总结
    201521044091 《Java程序设计》第5周学习总结
    201521044091 《Java程序设计》第2周学习总结
    201521044091 《Java程序设计》第3周学习总结
    MySQL设置字符集CHARACTER SET
    Create My MySQL configuration by Percona
    How to use jQuery to manipulate Cookies
    How to use OpenXml to import xml data to Sql server
  • 原文地址:https://www.cnblogs.com/Bob-wei/p/7514211.html
Copyright © 2020-2023  润新知