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运行机制也不是特别了解,不过既然朋友问到这个问题,虽 ...
随机推荐
- Gson 解析多层嵌套JSON数据
http://stackoverflow.com/questions/14139437/java-type-generic-as-argument-for-gson
- windows下的Mysql安装与基本使用(zip)
一.安装过程 Mysql社区版下载地址:http://dev.mysql.com/downloads/mysql/ --注意,已管理员身份运行cmd.exe,很重要!!目录在,c:\windows\s ...
- 001-es6变量声明、解构赋值、解构赋值主要用途
一.基本语法 1.1.声明变量的六种方法 参看地址:http://es6.ruanyifeng.com/#docs/let let:局部变量,块级作用域,声明前使用报错 var:全局变量,声明前使用 ...
- DateTimeTypeHandler
mysql-timestimp-------model-DateTime(jodatime) public class DataTimeTypeHandler extends BaseTypeHand ...
- django基础2: 路由配置系统,URLconf的正则字符串参数,命名空间模式,View(视图),Request对象,Response对象,JsonResponse对象,Template模板系统
Django基础二 request request这个参数1. 封装了所有跟请求相关的数据,是一个对象 2. 目前我们学过1. request.method GET,POST ...2. reques ...
- 第二课客户端链接Linux系统
使用Putty客户端软件连接Linux主机 使用rpm –qa | grep ssh命令查看是否已经安装ssh服务,如下图是已经安装了ssh服务,如果未列出相关的openssh那么代表未安装这时候就需 ...
- smarty内置函数
1.{append} 追加 2.{assign} 赋值 3.{block} 块 4.{call} 调用 5.{capture}捕获 6.{config_load}用来从配置文件中加载config变 ...
- zero-base coordinate 和one-base coordinate
zero-base和one-base是生信会经常碰到的两套坐标系统. zero-base是半开放式的,是不包括该点的,zero-base的文件有:bed;bam one-base是封闭式的,是包括该点 ...
- Ubuntu gcc错误:对'log'等函数未定义的引用
Ubuntu gcc错误:对'log'等函数未定义的引用 a.c #include <stdio.h>#include <math.h>int main(){ float ...
- javascript-实现简单瀑布流
直接上代码: <style> *{ margin:0; padding:0; } .waterfall_item{ border:solid 3px #ccc; box-shadow:1p ...