Windows Desktop Optimization.bat

Posted 备忘录

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Windows Desktop Optimization.bat相关的知识,希望对你有一定的参考价值。

Windows Desktop Optimization
============================
Microsoft Windows 10 Enterprise 2016 LSTB
Current Domain: DESKTOP-G3MPCR3
Current User: Administrator

Are you ready? (Y/N):y
(1/3) Config Service
- [Disabled] Windows Update
- [Disabled] Windows Search
- [Manual] Update Orchestrator Service for Windows Update
- [Manual] Superfetch
- [Disabled] Security Center
- [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
(2/3) Config Registry And Settings
- Disable UAC (NEED REBOOT)
- Disable TCP Auto-Tuning
- Hide This PC 6 folders
- 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
(3/3) Config Appx
- Remove XBox
- Remove Zune
- Remove Bing

Press any key to EXIT...

 

 Windows Desktop Optimization.bat

  1 @echo off
  2 pushd %~dp0
  3 set currentuser=%username%
  4 echo Windows Desktop Optimization
  5 echo ============================
  6 PowerShell /Command "&{Get-WmiObject -Class Win32_OperatingSystem | Select-Object -ExpandProperty Caption}"
  7 echo Current Domain: %USERDOMAIN%
  8 echo Current User: %currentuser%
  9 echo.
 10 set /p tmpInput=Are you ready? (Y/N):
 11 if /i "%tmpInput%"=="y" goto :START
 12 echo Canelled.
 13 echo Press any key to exit...
 14 pause>nul
 15 goto :END
 16 :START
 17 echo (1/3) Config Service
 18 echo - [Disabled] Windows Update
 19 call :disableService wuauserv
 20 echo - [Disabled] Windows Search
 21 call :disableService WSearch
 22 echo - [Manual] Update Orchestrator Service for Windows Update
 23 call :manualService UsoSvc
 24 echo - [Manual] Superfetch
 25 call :manualService SysMain
 26 echo - [Disabled] Security Center
 27 call :disableService wscsvc
 28 echo - [Disabled] Network Connected Devices Auto-Setup
 29 call :disableService NcdAutoSetup
 30 echo - [Disabled] Microsoft Windows SMS Router Service
 31 call :disableService SmsRouter
 32 echo - [Disabled] HomeGroup Provider Server
 33 call :disableService HomeGroupProvider
 34 echo - [Disabled] HomeGroup Listener Server
 35 call :disableService HomeGroupListener
 36 echo - [Manual] Function Discovery Resource Publication
 37 call :manualService FDResPub
 38 echo - [Manual] Function Discovery Provider Host
 39 call :manualService fdPHost
 40 echo (2/3) Config Registry And Settings
 41 echo - Disable UAC (NEED REBOOT)
 42 reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "EnableLUA" /t REG_DWORD /d 0x0 /f>nul
 43 echo - Disable TCP Auto-Tuning
 44 netsh interface tcp set heuristics disabled>nul
 45 echo - Hide This PC 6 folders
 46 reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{088e3905-0323-4b02-9826-5d99428e115f}" /f>nul 2>nul
 47 reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{24ad3ad4-a569-4530-98e1-ab02f9417aa8}" /f>nul 2>nul
 48 reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3dfdf296-dbec-4fb4-81d1-6a3438bcf4de}" /f>nul 2>nul
 49 reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}" /f>nul 2>nul
 50 reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{d3162b92-9365-467a-956b-92703aca08af}" /f>nul 2>nul
 51 reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{f86fa3ab-70d2-4fc7-9c99-fcbf05467f3a}" /f>nul 2>nul
 52 echo - Show extensions for known file types
 53 reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "HideFileExt" /t REG_DWORD /d 0x0 /f>nul
 54 echo - Open File Explorer to This PC
 55 reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "LaunchTo" /t REG_DWORD /d 0x1 /f>nul
 56 echo - Hide recently used files in Quick access
 57 reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" /v "ShowRecent" /t REG_DWORD /d 0x0 /f>nul
 58 echo - Hide frequently used files in Quick access
 59 reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" /v "ShowRecent" /t REG_DWORD /d 0x0 /f>nul
 60 echo - Hide Recycle bin on Desktop
 61 reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v "{645FF040-5081-101B-9F08-00AA002F954E}" /t REG_DWORD /d 0x1 /f>nul
 62 reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" /v "{645FF040-5081-101B-9F08-00AA002F954E}" /t REG_DWORD /d 0x1 /f>nul
 63 ::echo - Show Recycle bin on This PC
 64 ::reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{645FF040-5081-101B-9F08-00AA002F954E}" /f>nul
 65 ::rem reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{645FF040-5081-101B-9F08-00AA002F954E}" /f>nul 2>nul
 66 echo - Pin Recycle bin to Quick access
 67 reg add "HKCR\CLSID\{645FF040-5081-101B-9F08-00AA002F954E}\shell\pintohome" /v "MUIVerb" /t REG_SZ /d "@shell32.dll,-51377" /f>nul
 68 reg add "HKCR\CLSID\{645FF040-5081-101B-9F08-00AA002F954E}\shell\pintohome\command" /v "DelegateExecute" /t REG_SZ /d "{b455f46e-e4af-4035-b0a4-cf18d2f6f28e}" /f>nul
 69 PowerShell /Command "&{$o=New-Object -ComObject shell.application;$o.Namespace(‘shell:::{645FF040-5081-101B-9F08-00AA002F954E}‘).Self.InvokeVerb(‘pintohome‘)}">nul
 70 reg delete "HKCR\CLSID\{645FF040-5081-101B-9F08-00AA002F954E}\shell\pintohome" /f>nul
 71 echo (3/3) Config Appx
 72 echo - Remove XBox
 73 call :removeAppx *xbox*
 74 echo - Remove Zune
 75 call :removeAppx *zune*
 76 echo - Remove Bing
 77 call :removeAppx *bing*
 78 echo.
 79 echo Press any key to EXIT...
 80 pause>nul
 81 goto :END
 82 :disableService
 83 call :configService %1 4 null stop
 84 goto :eof
 85 :manualService
 86 call :configService %1 3 null stop
 87 goto :eof
 88 :configService
 89 ::%1 is service name (not DisplayName)
 90 ::%2 is startup type (2-Automatic, 3-Manual, 4-Disabled)
 91 ::%3 is DelayedAutostart (1-Enabled, 0-Disable, null-skip)
 92 ::%4 is net command (start, stop, null-skip)
 93 set serviceName=%~1
 94 if "%serviceName%"=="" goto :eof
 95 if "%2"=="" goto :eof
 96 set regKey="HKLM\SYSTEM\CurrentControlSet\services\%serviceName%"
 97 reg query %regKey% /v Start>nul 2>nul
 98 if ERRORLEVEL 1 goto :eof
 99 reg add %regKey% /v Start /t REG_DWORD /d %2 /f>nul
100 if "%3"=="" goto :eof
101 if /i %3==null goto :eof
102 reg add %regKey% /v DelayedAutostart /t REG_DWORD /d %3 /f>nul
103 if "%4"=="" goto :eof
104 if /i %4==null goto :eof
105 net %4 %serviceName%>nul
106 goto :eof
107 :removeAppx
108 if "%1"=="" goto :eof
109 PowerShell /Command "&{Get-AppxPackage %1 | Remove-AppxPackage}">nul
110 ::%1 filter
111 goto :eof
112 :END
113 popd

 

以上是关于Windows Desktop Optimization.bat的主要内容,如果未能解决你的问题,请参考以下文章

[函数] Firemonkey 取得 Windows 目前 User 的 Desktop 目录

Ubuntu desktop 文件(相当于Windows快捷方式)

Windows Desktop Optimization.bat

c++ 中是不是有类似 java 中的 Desktop 类的类? (特定于 Windows)

MCSA / Windows Server 2016 安装Desktop Experience

Windows 上 GitHub Desktop 的操作