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
时间: 2024-10-11 22:45:20

Windows Desktop Optimization.bat的相关文章

windows desktop.ini

win7桌面上的两个desktop.ini文件千万不要删除,win7系统里的desktop.ini文件是有用的. 详解 Desktop.ini 配置设置文件1 http://blog.sina.com.cn/s/blog_51a4af870100ar7k.html 详解 Desktop.ini 配置设置文件2 http://blog.sina.com.cn/s/blog_51a4af870100areq.html 详解 Desktop.ini 配置设置文件3 http://blog.sina.c

windows批处理(cmd/bat)编程详解

reference: http://blog.csdn.net/bingjie1217/article/details/12947327 http://www.cnblogs.com/doit8791/archive/2012/05/20/2511001.html 开始之前先简单说明下cmd文件和bat文件的区别:在本质上两者没有区别,都是简单的文本编码方式,都可以用记事本创建.编辑和查看.两者所用的命令行代码也是共用的,只是cmd文件中允许使用的命令要比bat文件多.cmd文件只有在windo

[quote ]ffmpeg, gstreamer, Raspberry Pi, Windows Desktop streaming

[quote ]ffmpeg, gstreamer, Raspberry Pi, Windows Desktop streaming http://blog.pi3g.com/2013/08/ffmpeg-gstreamer-raspberry-pi-windows-desktop-streaming/ This is a work still in progress with unsatisfactory results (image quality, delay, very low fram

XenApp_XenDesktop_7.6实战篇之十三:安装Virtual Delivery Agent For Windows Desktop OS

在前面的章节我们已经非常详细的完成了基础环境.数据库.License Server和Delivery Controller等组件的部署和配置工作.在Citrix XenDesktop和XenApp交付桌面和应用时,必须在被交付的Windows Desktop OS 或Windows Server OS上安装相应的Agent,今天为大家分享如何安装Virtual Delivery Agent For Windows Desktop OS. 1.1 创建好Win7虚拟机-修改主机名和IP地址-加入域

Windows 批处理(cmd/bat)常用命令教程

Windows批处理(cmd/bat)常用命令教程 简单详细,建议收藏 前言 批处理文件(batch file)包含一系列 DOS命令,通常用于自动执行重复性任务.用户只需双击批处理文件便可执行任务,而无需重复输入相同指令.编写批处理文件非常简单,但难点在于确保一切按顺序执行.编写严谨的批处理文件可以极大程度地节省时间,在应对重复性工作时尤其有效 在Windows中善用批处理可以简化很多重复工作 什么是批处理? 批处理(Batch),也称为批处理脚本.顾名思义,批处理就是对某对象进行批量的处理.

Windows下面startup.bat启动Tomcat偶发死锁问题

Windows下面startup.bat启动Tomcat时,因为日志都打印到了cmd里面,存在偶发卡死Tomcat的问题,该问题确认是Windows系统的问题,而且一直没有解决.解决的办法是把日志重定向到日志文件. dump了JVM的堆栈,如下所示: 2018-05-24 11:30:41Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.131-b11 mixed mode): "JMX server connection timeou

Windows Server下把BAT批处理注册成服务在后台运行且注销后能正常运行

批处理有如下特点: 1.登录到当前窗口运行时,如果关闭控制台会连同启动的程序一起关闭. 2.如果是以start /b的形式启动,那么同样也是在控制台关闭后者注销当前窗口也会一起关闭. 3.如果以vbs的形式启动,注销当前用户也会一起关闭. 有如下方式解决: 1.使用[任务计划]去启动批处理,里面有很多个触发点,可以选择[计算机启动时]触发也能达到开机启动的效果,而不用登录桌面. 2.有错误启动Windows Service方式,用[sc]命令注册服务,然后以cmd.exe的形式去启动(C:\Wi

FAQ系列 | 如何在windows下用bat脚本定时备份mysql

并不是所有MySQL都运行在Linux下,windows下也需要做例行备份,下面是用bat脚本做自动化备份的例子,大家可以参考下. remrem C:\Program Files\WinRAR 需要放到 path 下,才能调用rar cli工具remrem 跳转到工作目录下f:cd f:\DBBAKrem 设置变量:备份文件名SET BAK_FILE=MY_DBBAK_%date:~0,-4%.sqlrem 设置变量:日志文件名SET LOG_FILE=MY_DBBAK.logrem 记录日志e

Windows下的bat中文乱码问题

起初拿到一个bat文件,我在修改时看到编码是gb2312,我就直接将其转变为了utf8...但是在执行后的黑窗口出现中文乱码问题,最后网上获取帮助是修改编码为ANSI编码,确实不出现乱码了,ANSI是什么编码呢,原来它是一个代表值.. 不同的国家和地区制定了不同的标准,由此产生了 GB2312.GBK.Big5.Shift_JIS 等各自的编码标准.这些使用 1 至 4 个字节来代表一个字符的各种汉字延伸编码方式,称为 ANSI 编码.在简体中文Windows操作系统中,ANSI 编码代表 GB