|
本帖最后由 Trace6 于 2024-10-9 11:08 编辑
给你一个很早之前写的批处理,虽然跟你现在的需求不一样,但是具备一定的参考价值。
下面这个批处理不兼容win8和2012系统(会出现中文问号),Win10和Win11环境都是通用的,也不会出现中文问号的问题。
前面发给你的注册表是优化后的版本,更精简了一些,也可以兼容win8和2012系统。
所以,你自己酌情参考吧。提取你自己需要的代码使用就行了。- @echo off
- title 暗安全兴趣小组 [https://duiz.net]
- color 0a
- rem 获取管理员权限
- %1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit
- cd /d "%~dp0"
- rem 结束资源管理器
- taskkill /f /im explorer.exe >nul 2>nul
- rem 首先清空输入法列表
- reg delete "HKCU\Control Panel\International\User Profile\zh-Hans-CN" /f
- rem 删除微软拼音输入法
- reg delete "HKCU\Software\Microsoft\CTF\SortOrder\AssemblyItem\0x00000804\{34745C63-B2F0-4784-8B67-5E12C8701A31}\00000003" /f
- reg delete "HKCU\Software\Microsoft\CTF\TIP\{81D4E9C9-1D3B-41BC-9E6C-4B40BF79E35E}" /f
- rem 删除微软五笔输入法
- reg delete "HKCU\Software\Microsoft\CTF\SortOrder\AssemblyItem\0x00000804\{34745C63-B2F0-4784-8B67-5E12C8701A31}\00000003" /f
- reg delete "HKCU\Software\Microsoft\CTF\TIP\{6A498709-E00B-4C45-A018-8F9E4081AE40}" /f
- rem 在Windows设置里添加美国键盘的英语,并设置为第一位
- reg add "HKCU\Control Panel\International\User Profile" /v "InputMethodOverride" /t REG_SZ /d "0804:00000409" /f
- rem 设置页面输入法排序,1表示第一位
- reg add "HKCU\Control Panel\International\User Profile\zh-Hans-CN" /v "0804:00000409" /t REG_DWORD /d "1" /f
- rem 设置页面输入法排序,搜狗拼音,设置第二位
- reg add "HKCU\Control Panel\International\User Profile\zh-Hans-CN" /v "0804:{E7EA138E-69F8-11D7-A6EA-00065B844310}{E7EA138F-69F8-11D7-A6EA-00065B844311}" /t REG_DWORD /d "2" /f
- rem 设置页面输入法排序,搜狗五笔,设置第三位
- reg add "HKCU\Control Panel\International\User Profile\zh-Hans-CN" /v "0804:{E7EA138F-69F8-11D7-A6EA-00065B844310}{E7EA1390-69F8-11D7-A6EA-00065B844311}" /t REG_DWORD /d "3" /f
- rem 设置语言栏输入法排序
- rem 清空现有语言栏列表
- reg delete "HKCU\Software\Microsoft\CTF\SortOrder\AssemblyItem\0x00000804\{34745C63-B2F0-4784-8B67-5E12C8701A31}" /f
- rem 言栏输入法排序,设置美国键盘的英语为第一位
- reg add "HKCU\Software\Microsoft\CTF\SortOrder\AssemblyItem\0x00000804\{34745C63-B2F0-4784-8B67-5E12C8701A31}\00000000" /v "CLSID" /t REG_SZ /d "{00000000-0000-0000-0000-000000000000}" /f
- reg add "HKCU\Software\Microsoft\CTF\SortOrder\AssemblyItem\0x00000804\{34745C63-B2F0-4784-8B67-5E12C8701A31}\00000000" /v "Profile" /t REG_SZ /d "{00000000-0000-0000-0000-000000000000}" /f
- reg add "HKCU\Software\Microsoft\CTF\SortOrder\AssemblyItem\0x00000804\{34745C63-B2F0-4784-8B67-5E12C8701A31}\00000000" /v "KeyboardLayout" /t REG_DWORD /d "67700740" /f
- rem 言栏输入法排序,搜狗拼音,设置第二位
- reg add "HKCU\Software\Microsoft\CTF\SortOrder\AssemblyItem\0x00000804\{34745C63-B2F0-4784-8B67-5E12C8701A31}\00000001" /v "CLSID" /t REG_SZ /d "{E7EA138E-69F8-11D7-A6EA-00065B844310}" /f
- reg add "HKCU\Software\Microsoft\CTF\SortOrder\AssemblyItem\0x00000804\{34745C63-B2F0-4784-8B67-5E12C8701A31}\00000001" /v "Profile" /t REG_SZ /d "{E7EA138F-69F8-11D7-A6EA-00065B844311}" /f
- reg add "HKCU\Software\Microsoft\CTF\SortOrder\AssemblyItem\0x00000804\{34745C63-B2F0-4784-8B67-5E12C8701A31}\00000001" /v "KeyboardLayout" /t REG_DWORD /d "0" /f
- rem 言栏输入法排序,搜狗五笔,设置第三位
- reg add "HKCU\Software\Microsoft\CTF\SortOrder\AssemblyItem\0x00000804\{34745C63-B2F0-4784-8B67-5E12C8701A31}\00000002" /v "CLSID" /t REG_SZ /d "{E7EA138F-69F8-11D7-A6EA-00065B844310}" /f
- reg add "HKCU\Software\Microsoft\CTF\SortOrder\AssemblyItem\0x00000804\{34745C63-B2F0-4784-8B67-5E12C8701A31}\00000002" /v "Profile" /t REG_SZ /d "{E7EA1390-69F8-11D7-A6EA-00065B844311}" /f
- reg add "HKCU\Software\Microsoft\CTF\SortOrder\AssemblyItem\0x00000804\{34745C63-B2F0-4784-8B67-5E12C8701A31}\00000002" /v "KeyboardLayout" /t REG_DWORD /d "0" /f
- rem 固定键盘布局,防止万象篡改输入法!(不知是否有缺陷,非无盘客户机环境,建议先不要执行这段命令)
- "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -command "& {get-WinUserLanguageList | Set-WinUserLanguageList -Force}"
- rem 使用 d0000804 键盘布局替换掉 00000804 键盘布局,解决打字出现问号或者游戏中无法打字的情况。
- reg delete "HKCU\Keyboard Layout" /f
- reg add "HKCU\Keyboard Layout\Preload" /v "1" /t REG_SZ /d "d0000804" /f
- rem 使用 "美式键盘" 替换掉默认的 "简体中文"
- reg add "HKCU\Keyboard Layout\Substitutes" /v "d0000804" /t REG_SZ /d "00000409" /f
- rem 设置 "美式键盘" 为默认输入法
- reg add "HKCU\Software\Microsoft\CTF\Assemblies\0x00000804\{34745C63-B2F0-4784-8B67-5E12C8701A31}" /v "Default" /t REG_SZ /d "{00000000-0000-0000-0000-000000000000}" /f
- reg add "HKCU\Software\Microsoft\CTF\Assemblies\0x00000804\{34745C63-B2F0-4784-8B67-5E12C8701A31}" /v "Profile" /t REG_SZ /d "{00000000-0000-0000-0000-000000000000}" /f
- reg add "HKCU\Software\Microsoft\CTF\Assemblies\0x00000804\{34745C63-B2F0-4784-8B67-5E12C8701A31}" /v "KeyboardLayout" /t REG_DWORD /d "67700740" /f
- reg add "HKCU\Software\Microsoft\CTF\HiddenDummyLayouts" /v "00000804" /t REG_SZ /d "00000804" /f
- rem 隐藏通知区域输入指示器
- reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3" /v "Settings" /t reg_binary /d 30000000feffffff02200000030000003e00000028000000000000001004000080070000380400006000000001000000 /f
- rem 设置输入法模式为传统模式(使用桌面语言栏)
- powershell -NonInteractive Set-WinLanguageBarOption –UseLegacyLanguageBar
- rem 设置语言栏样式:隐藏图标并停靠在任务栏
- reg add "HKCU\Software\Microsoft\CTF\LangBar" /v "ExtraIconsOnMinimized" /t REG_DWORD /d "0" /f
- reg add "HKCU\Software\Microsoft\CTF\LangBar" /v "ShowStatus" /t REG_DWORD /d "4" /f
- rem 允许我为每个应用窗口使用不同的输入法
- reg add "HKCU\Control Panel\Desktop" /v "UserPreferencesMask" /t REG_BINARY /d "9016038090010000" /f
- shutdown -r -t 3 /c "输入法切换完毕,重启后继续……"
复制代码
|
评分
-
查看全部评分
|