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 XBoxRemove ZuneRemove Bing
Windows Desktop Optimization.bat
@echo off
pushd %~dp0
set currentuser=%username%
rem UAC code begin
set getadminfile="%temp%\getadmin.vbs"
echo Windows Desktop Optimization
echo ============================
echo Starting
"%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\SYSTEM" >nul 2>nul
if %ERRORLEVEL% EQU 0 (
goto :Admin
) else (
if %ERRORLEVEL% EQU 2 (
goto :PathErr
) else (
goto :UAC
)
)
:PathErr
echo.
echo Please open "%~n0%~x0" by explorer.exe
echo.
echo Press any key to explore the folder...
pause>nul
start "" "%SYSTEMROOT%\system32\explorer.exe" /select,"%~f0"
goto :END
:UAC
echo Set sh = CreateObject^("Shell.Application"^) > %getadminfile%
echo sh.ShellExecute "%~f0", "", "", "runas", 1 >> %getadminfile%
ping 127.1 -n 1 >nul
"%SYSTEMROOT%\system32\cscript.exe" %getadminfile%
goto :END
:Admin
if exist %getadminfile% ( del %getadminfile% )
cls
rem UAC code end
echo Windows Desktop Optimization
echo ============================
::PowerShell /Command "&{Get-WmiObject -Class Win32_OperatingSystem | Select-Object -ExpandProperty Caption}"
set caption=
for /f "skip=1 delims=" %%t in ('wmic os get caption') do (
if not defined caption set caption=%%t
)
echo %caption%
echo Current Domain: %USERDOMAIN%
echo Current User: %currentuser%
echo.
set /p tmpInput=Are you ready? (Y/N):
if /i "%tmpInput%"=="y" goto :START
echo Canelled.
echo Press any key to exit...
pause>nul
goto :END
:START
echo (1/3) Config Service
echo - [Disabled] Windows Update
call :disableService wuauserv
echo - [Disabled] Windows Search
call :disableService WSearch
echo - [Manual] Update Orchestrator Service for Windows Update
call :manualService UsoSvc
echo - [Manual] Superfetch
call :manualService SysMain
::echo - [Disabled] Security Center
::call :disableService wscsvc
echo - [Disabled] Network Connected Devices Auto-Setup
call :disableService NcdAutoSetup
echo - [Disabled] Microsoft Windows SMS Router Service
call :disableService SmsRouter
echo - [Disabled] HomeGroup Provider Server
call :disableService HomeGroupProvider
echo - [Disabled] HomeGroup Listener Server
call :disableService HomeGroupListener
echo - [Manual] Function Discovery Resource Publication
call :manualService FDResPub
echo - [Manual] Function Discovery Provider Host
call :manualService fdPHost
echo (2/3) Config Registry And Settings
echo - Disable UAC (* REBOOT)
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "EnableLUA" /t REG_DWORD /d 0x0 /f>nul
::echo - Disable Windows Defender
::reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender" /v "DisableAntiSpyware" /t REG_DWORD /d 0x1 /f>nul
echo - Disable TCP Auto-Tuning
netsh interface tcp set heuristics disabled>nul
echo - Hide This PC 7 folders (* RESTART EXPLORER)
rem 3D Objects
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
rem Desktop
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
rem Documents
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
rem Downloads
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
rem Music
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
rem Pictures
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
rem Videos
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
echo - Show extensions for known file types
reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "HideFileExt" /t REG_DWORD /d 0x0 /f>nul
echo - Open File Explorer to This PC
reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "LaunchTo" /t REG_DWORD /d 0x1 /f>nul
echo - Hide recently used files in Quick access
reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" /v "ShowRecent" /t REG_DWORD /d 0x0 /f>nul
echo - Hide frequently used files in Quick access
reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" /v "ShowFrequent" /t REG_DWORD /d 0x0 /f>nul
echo - Hide Recycle bin on Desktop
reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v "{645FF040-5081-101B-9F08-00AA002F954E}" /t REG_DWORD /d 0x1 /f>nul
reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" /v "{645FF040-5081-101B-9F08-00AA002F954E}" /t REG_DWORD /d 0x1 /f>nul
::echo - Show Recycle bin on This PC
::reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{645FF040-5081-101B-9F08-00AA002F954E}" /f>nul
::rem reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{645FF040-5081-101B-9F08-00AA002F954E}" /f>nul 2>nul
echo - Pin Recycle bin to Quick access
call :pintohomeCLSID {645FF040-5081-101B-9F08-00AA002F954E}
::echo - Pin GodMode control panel to Quick access
::call :pintohomeDir "Control Panel (GodMode).{ED7BA470-8E54-465E-825C-99712043E01C}"
echo - Disable Windows Feedback
reg add "HKCU\Software\Microsoft\Siuf\Rules" /v "NumberOfSIUFInPeriod" /t REG_DWORD /d 0x0 /f>nul
reg add "HKCU\Software\Microsoft\Siuf\Rules" /v "PeriodInNanoSeconds" /t REG_DWORD /d 0x0 /f>nul
echo - Disable Application Experience task schedulers
schtasks /change /tn "\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" /disable>nul 2>nul
schtasks /change /tn "\Microsoft\Windows\Application Experience\ProgramDataUpdater" /disable>nul 2>nul
schtasks /change /tn "\Microsoft\Windows\Application Experience\StartupAppTask" /disable>nul 2>nul
echo - Disable Customer Experience Improvement Program task schedulers
schtasks /change /tn "\Microsoft\Windows\Customer Experience Improvement Program\Consolidator" /disable>nul 2>nul
schtasks /change /tn "\Microsoft\Windows\Customer Experience Improvement Program\KernelCeipTask" /disable>nul 2>nul
schtasks /change /tn "\Microsoft\Windows\Customer Experience Improvement Program\UsbCeip" /disable>nul 2>nul
echo (3/3) Config Appx
echo - Nothing to do.
::echo - Remove XBox
::call :removeAppx *xbox*
::echo - Remove Zune
::call :removeAppx *zune*
::echo - Remove Bing
::call :removeAppx *bing*
echo.
echo Press any key to EXIT...
pause>nul
goto :END
:pintohomeCLSID
reg add "HKCR\CLSID\%1\shell\pintohome" /v "MUIVerb" /t REG_SZ /d "@shell32.dll,-51377" /f>nul
reg add "HKCR\CLSID\%1\shell\pintohome\command" /v "DelegateExecute" /t REG_SZ /d "{b455f46e-e4af-4035-b0a4-cf18d2f6f28e}" /f>nul
PowerShell /Command "&{$o=New-Object -ComObject shell.application;$o.Namespace('shell:::%1').Self.InvokeVerb('pintohome')}">nul
reg delete "HKCR\CLSID\%1\shell\pintohome" /f>nul
goto :eof
:pintohomeDir
set tmpDir=%userprofile%\Desktop\%~1
md "%tmpDir%">nul
PowerShell /Command "&{$o=New-Object -ComObject shell.application;$o.Namespace('%tmpDir%').Self.InvokeVerb('pintohome')}">nul
rd /q "%tmpDir%">nul
goto :eof
:disableService
call :configService %1 4 null stop
goto :eof
:manualService
call :configService %1 3 null stop
goto :eof
:configService
::%1 is service name (not DisplayName)
::%2 is startup type (2-Automatic, 3-Manual, 4-Disabled)
::%3 is DelayedAutostart (1-Enabled, 0-Disable, null-skip)
::%4 is net command (start, stop, null-skip)
set serviceName=%~1
if "%serviceName%"=="" goto :eof
if "%2"=="" goto :eof
set regKey="HKLM\SYSTEM\CurrentControlSet\services\%serviceName%"
reg query %regKey% /v Start>nul 2>nul
if ERRORLEVEL 1 goto :eof
reg add %regKey% /v Start /t REG_DWORD /d %2 /f>nul
if "%3"=="" goto :eof
if /i %3==null goto :eof
reg add %regKey% /v DelayedAutostart /t REG_DWORD /d %3 /f>nul
if "%4"=="" goto :eof
if /i %4==null goto :eof
net %4 %serviceName%>nul
goto :eof
:removeAppx
if "%1"=="" goto :eof
PowerShell /Command "&{Get-AppxPackage %1 | Remove-AppxPackage}">nul
::%1 filter
goto :eof
:END
if exist %getadminfile% ( del %getadminfile% )
popd
Windows Desktop Optimization.bat的更多相关文章
- [2018.05].NET Core 3 and Support for Windows Desktop Applications
.NET Core 3 and Support for Windows Desktop Applications Richard 微软官网的内容...net 3.0 升级任务 任重道远 https:/ ...
- python windows 远程执行bat
本机环境:Win 10,python3.6 远程机器: Win7.WinServer 因python在windows上执行需要用到 wmi 模块. wmi 模块下载地址:https://sourcef ...
- 在Windows下使用BAT调度存储在资源库中的KTR
描述: 在Windows下使用BAT调度存储在资源库中的KTR 准备环境: 1.ktr文件(该KTR必须是存储在资源管库中的) 2.bat文件 @echo off D: cd D:\software\ ...
- [quote ]ffmpeg, gstreamer, Raspberry Pi, Windows Desktop streaming
[quote ]ffmpeg, gstreamer, Raspberry Pi, Windows Desktop streaming http://blog.pi3g.com/2013/08/ffmp ...
- windows desktop.ini
win7桌面上的两个desktop.ini文件千万不要删除,win7系统里的desktop.ini文件是有用的. 详解 Desktop.ini 配置设置文件1 http://blog.sina.com ...
- [转帖]Windows批处理(cmd/bat)常用命令小结
Windows批处理(cmd/bat)常用命令小结 非常值得学习的文档 先放这里 有时间做实验, 转载自:“趣IT”微信公共号 前言 批处理文件(batch file)包含一系列 DOS命令,通常用于 ...
- Windows 批处理(cmd/bat)常用命令教程
Windows批处理(cmd/bat)常用命令教程 简单详细,建议收藏 常见问题: 1.如果你自己编写的.bat文件,双击打开,出现闪退 2.批处理.bat 文件中输出中文乱码 解决方法在文章末尾! ...
- int.TryParse非预期执行引发的思考 ASP.NET -- WebForm -- 给图片添加水印标记 Windows -- 使用批处理文件.bat删除旧文件
int.TryParse非预期执行引发的思考 问题出现 这天在写一个页面,想谨慎些就用了int.TryParse,结果出问题了. 代码如下: Copy int id = 1000; //Reque ...
- windows开机自启动bat脚本设置
群里有朋友问到windows下如何设计开机自启动的脚本,一般而言小鱼大多还是在linux环境下运维,windows的bat了解的很少,windows运行机制也不是特别了解,不过既然朋友问到这个问题,虽 ...
随机推荐
- 转!!SpringMVC与Struts2区别与比较总结
1.Struts2是类级别的拦截, 一个类对应一个request上下文,SpringMVC是方法级别的拦截,一个方法对应一个request上下文,而方法同时又跟一个url对应,所以说从架构本身上Spr ...
- scrapy 原理,结构,基本命令,item,spider,selector简述
原理,结构,基本命令,item,spider,selector简述 原理 (1)结构 (2)运行流程 实操 (1) scrapy命令: 注意先把python安装目录的scripts文件夹添加到环境变量 ...
- 深入理解CNI
1.为什么会有CNI? CNI是Container Network Interface的缩写,简单地说,就是一个标准的,通用的接口.已知我们现在有各种各样的容器平台:docker,kubernetes ...
- Python 模块之 pyexcel_xls
一.适用场景 在很多数据统计或者数据分析的场景中,我们都会使用到excel: 在一些系统中我们也会使用excel作为数据导入和导出的方式,那么如何使用python加以辅助我们快速进行excel数据做更 ...
- Oracle 11g数据库详解(3)
ORA-14025:不能为实体化视图或实体化视图日志指定PARTITION ORA-14026:PARTITION和CLUSTER子句互相排斥 ORA-14027:仅可以指定一个PARTITION子句 ...
- Java AES512加密算法
AES - 高级加密标准: 高级加密标准(英语:Advanced Encryption Standard,缩写:AES),在密码学中又称Rijndael加密法,是美国联邦政府采用的一种区块加密标准.这 ...
- responseEntity 实现文件下载
@RequestMapping("/testResponseEntity") public ResponseEntity<byte[]> testResponseEnt ...
- 开源流量分析系统 Apache Spot 概述(转)
原文地址http://blog.nsfocus.net/apache-spot/ Apache Spot 是一个基于网络流量和数据包分析,通过独特的机器学习方法,发现潜在安全威胁和未知网络攻击能力的开 ...
- promise两个参数的具体作用
Promise通常配合then方法来链式的使用,then方法里面第一个回调函数表示成功状态,也就是resolve通过.then调用,第二个是失败状态-reject通过.Cath调用,如果默认写一个参数 ...
- Python中用format函数格式化字符串的用法(2.7版本讲解哦!)
语法 它通过{}和:来代替%.“映射”示例 通过位置 In [1]: '{0},{1}'.format('kzc',18) Out[1]: 'kzc,18' In [2]: '{},{}'.forma ...