Downloads
MSDN Windows 11 CO-21H2 (22000.194),2021-10-05
en-us_windows_11_business_editions_x64_dvd_3a304c08.iso
Size: 5.12 GB
MD5: 3D1247F0B9CF446326891318535E913F
SHA-256: 667BD113A4DEB717BC49251E7BDC9F09C2DB4577481DDFBCE376436BEB9D1D2F
zh-cn_windows_11_business_editions_x64_dvd_f5f6bcbd.iso
SHA-256: 81C007E119BB0CF0C58ABEA9D9578B4C09935F929E609FB3954AAB43BCB83269
测试 Windows 11 Enterprise 版可以正常 KMS 激活。
系统初始配置
卸载系统预装的垃圾软件
控制面板(control)或 settings 应用里卸载垃圾软件:
- OneDrive (注:安装 Microsoft Office 2019 / 2021 时默认会把 OneDrive 装回来,需要再次卸载)
可选: 禁用 hibernate
powercfg -hibernate off
使用 powercfg -a
查看当前系统的电源状态,Hibernate 应该已被禁用。
控制面板 (control)
搜索 time, 打开桌面版的 clock, 将 Internet 时间同步服务器设为 "ntp.ntsc.ac.cn"
PowerShell
解除 PowerShell 运行脚本安全限制。在 PS (可能需要显式 run as administrator)里执行:
Set-ExecutionPolicy Bypass
系统组件
Settings - Optional features, 安装 / 启用 Wireless Display 和 OpenSSH Server。
开始菜单搜索 Windows features 打开 "Turn Windows features on or off",启用以下组件:
- .NET Framework 3.5 (includes .NET 2.0 and 3.0)
- Hyper-V
- Telnet client
- TFTP client
- Windows Hypervisor Platform
- Windows Sandbox
- Windows subsystem for Linux
重启。
services.msc 里启动并将 OpenSSH SSH Server (sshd) 和 OpenSSH Authentication Agent (ssh-agent) 这2个服务启动类型设为 automatic。
驱动
测试对于某些 intel 核显 + AMD 显卡的双显笔记本,AMD独显的驱动不会自动安装。建议使用 AMD 的官方工具 自动安装对应驱动。
wsl
安装微软提供的这个更新包。
cmd
wsl --list --online
wsl --install -d Ubuntu-20.04
ubuntu2004 config --default-user root
ubuntu2004
默认安装的是 WSL2 的 Linux。
装机必备软件
Windows 11 优化指南
测试于 Windows 11 enterprise (en-US) 初始版本。使用本地账户(domain account)登录。
准备工作:
- 根据这里的步骤,彻底禁用 UAC。
- 安装 InstallTakeOwnership 这个注册表文件,用于在资源管理器右键任意系统文件或文件夹接管 NTFS 所有权。
- 下载并运行 SuperCMD 这个(绿色)软件。此工具用于以 SYSTEM 最高用户权限运行任意命令。以下所有步骤里运行的命令均在 SuperCMD 启动的 cmd 里执行。
组策略配置项优化
首先用 run as administrator 执行 PowerShell,执行 "Install-Module -Name PolicyFileEditor -RequiredVersion 3.0.0" 安装 PolicyFileEditor 这个模块以运行程序方式访问组策略。(详细参考)
在 PowerShell 里执行命令修改若干组策略配置项:
禁用 Mark of the Web:
# User Configuration\Administrative Templates\Windows Components\Attachment Manager: Do not preserve zone information in file addachments
# 禁止 Windows 的 attachment manager 自动为网上下载的文件写入 Zone.Identifier 的 NTFS ADS (alternate data stream) 。即所谓的 Mark-of-the-Web (MOTW)。这个是傻逼 Windows 最脑残的安全特性,导致所有网上下载的文件打开或运行时都会弹窗提示。傻逼微软脑子有坑设计这个东西。
Set-PolicyFileEntry -Path "$env:windir\system32\GroupPolicy\User\Registry.pol" -Key Software\Microsoft\Windows\CurrentVersion\Policies\Attachments -ValueName SaveZoneInformation -Data '1' -Type DWord
# 使上面的修改生效
gpupdate /Force
删除资源管理器里的各种 "Folders" 垃圾文件夹快捷方式
即资源管理器 "This PC" 下显示的一堆 "Desktop", "Pictures", "Documents" 等垃圾文件夹链接。
RemoveFoldersFromExplorer.reg
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}\PropertyBag]
"ThisPCPolicy"="Hide"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{f42ee2d3-909f-4907-8871-4c22fc0bf756}\PropertyBag]
"ThisPCPolicy"="Hide"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{7d83ee9b-2244-4e70-b1f5-5393042af1e4}\PropertyBag]
"ThisPCPolicy"="Hide"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{a0c69a99-21c8-4671-8703-7934162fcf1d}\PropertyBag]
"ThisPCPolicy"="Hide"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{0ddd015d-b06c-45d5-8c4c-f59713854639}\PropertyBag]
"ThisPCPolicy"="Hide"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{35286a68-3c57-41a1-bbb1-0eae73d76c95}\PropertyBag]
"ThisPCPolicy"="Hide"
禁用 Windows Defender / Security 等安全组件
去除运行 exe 等文件时安全警告
首先打开 Windows Security,App & browser control, Reputation-based protection settings, 关闭所有几个选项:
- Check app and files
- SmartScreen for Microsoft Edge
- SmartScreen for Microsoft Store apps
导入以下几个 reg 注册表文件:
DisableIESecuritySettingsCheck.reg
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Security]
"DisableSecuritySettingsCheck"=dword:00000001
"DisableFixSecuritySettings"=dword:00000001
"DisableSecuritySettings"=dword:00000001
disable_open_file_security_warning.reg
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Associations ]
"LowRiskFileTypes"=".avi;.bat;.cmd;.exe;.htm;.html;.lnk;.mpg;.mpeg;.mov;.mp3;.mp4;.mkv;.msi;.m3u;.rar;.reg;.txt;.vbs;.wav;.zip;.7z"
运行 inetcpl.cpl 打开 Internet 选项,在 "Security" 页面,依点击"Internet", "Local intranet" 和 "Trusted sites" 三个 zone,对每个 zone,点击 Custom level,更改如下设置:
- Misc - Launching applications and unsafe files: 设为 Enable
- Misc - Launching programs and files in an IFRAME: 设为 Enable
禁用 Windows Defender & Windows Security
首先在 Windows Security - Virus & Thread protection - settings 里关闭 "Tamper protection",重启
regedit,打开以下路径的 service 注册表路径
- Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SecurityHealthService (Windows Security Service)
- Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\wscsvc (Security Center)
- Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinDefend (Microsoft Defender Antivirus Service)
- Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WdNisSvc (Microsoft Defender Antivirus Network Inspection Service)
将 Start 键值设为 4 (Disabled)。(服务启动类型说明:0 = Boot; 1 = System; 2 = Automatic; 3 = Manual; 4 = Disabled)
注意如果未关闭 tamper protection, Microsoft Defender 的两个服务无法修改注册表启动类型。
重启生效。
禁用 Windows Defender Firewall
直接在 Windows Defender Firewall - "Turn Windows Defender Firewall on or off" 里关闭防火墙即可。
不建议彻底禁用 Windows Defender Firewall (mpssvc) 服务。从 Windows 10 的后期版本开始傻逼微软将系统里很多网络功能特性都放到了 Defender Firewall 里,如果禁用了服务可能出现一些问题。
禁用垃圾定时任务
taskschd.msc 打开计划任务管理器,定位到以下位置:
- Task Scheduler Library / Microsoft / Windows / Application Experiance / : 右键禁用(disable) 所有任务。
- Task Scheduler Library / Microsoft / Windows / CloudExperianceHost / : 同上。
- Task Scheduler Library / Microsoft / Windows / Customer Experience Improvement Program / : 同上。
- Task Scheduler Library / Microsoft / Windows / Diagnosis / : 同上。
- Task Scheduler Library / Microsoft / Windows / Windows Defender / : 同上。
- Task Scheduler Library / Microsoft / Windows / Windows Error Reporting / : 同上。
禁用登录背景画面
与傻逼 Windows 10 相同,Windows 11 默认启动 / 锁屏后会显示一个全屏背景画面,必须按下任意键才进入输入密码界面。纯属傻逼设计。
DisableLockScreen.reg
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization]
"NoLockScreen"=dword:00000001
禁止开始菜单搜索显示 bing 结果
gpedit.msc, Computer Configuration / Administrative Templates / Windows Components / Search /,修改以下设置项为:
- Allow Cortana: Disable
- Allow search and Cortana to use location : Disable
- Do not allow web search : Enable
- Don't search the web or display web results in Search : Enable
根据微软文档,应该可以修改注册表达到同样效果:
DisableStartMenuWebSearch.reg
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search]
"AllowCortana"=dword:00000000
"AllowSearchToUseLocation"=dword:00000000
"DisableWebSearch"=dword:00000001
"ConnectedSearchUseWeb"=dword:00000001
但我测试改注册表无效,只能用组策略。
禁用 Windows Update 自动更新
使用 Windows Update Blocker v1.7 这个工具禁止 Windows 自动更新。
允许 RDP 保存密码 (Windows 11 22H2+)
Windows 11 新增的一个恶行特效(feature or bug?) Device Guard 禁止 rdp 使用保存的密码,每次都必须重新输入密码(提示 Can't use saved credential (Windows Defender Credential Guard does not allow using saved credentials))
解决方法:
Windows11_22H2_allow_use_save_credentials.reg
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceGuard]
"EnableVirtualizationBasedSecurity"=dword:00000000
"RequirePlatformSecurityFeatures"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa]
"LsaCfgFlags"=dword:00000000
修改注册表后需要重启。
删除 Context Menu 里的垃圾
删除 Context Menu 里的一堆垃圾。
Remove_garbage_from_context_menu_for_all_users.reg
Windows Registry Editor Version 5.00
; Remove garbage from Windows Explorer Context Menu
; Share
[-HKEY_CLASSES_ROOT\AllFilesystemObjects\shellex\ContextMenuHandlers\ModernSharing]
; Always Available Offline
[-HKEY_CLASSES_ROOT\AllFilesystemObjects\shellex\ContextMenuHandlers\{474C98EE-CF3D-41f5-80E3-4AAB0AB04301}]
; Restore Previous Versions
[-HKEY_CLASSES_ROOT\AllFilesystemObjects\shellex\ContextMenuHandlers\{596AB062-B4D2-4215-9F74-E9109B0A8153}]
; Give access to
[-HKEY_CLASSES_ROOT\AllFilesystemObjects\shellex\ContextMenuHandlers\{a2a9545d-a0c2-42b4-9708-a0b2badd77c8}]
卸载 Windows 自带的 UWP
cmd / PowerShell:
# 卸载 Windows Widget (Win + W 触发的 Widgets 面板)
winget uninstall "Windows web experience pack"