windows-cursor-scheme-fix README

The project's README from github.com/Arcadeq/windows-cursor-scheme-fix. As one markdown file: README.md.

Windows 11 自定义光标主题不生效(Arrow/Hand/忙碌等)或始终显示 Windows Aero 光标主题的问题修复

更新了 Windows 11 最新版后发现,在部分 Windows 11 环境中,自定义鼠标光标方案已经正确安装,注册表中的路径也完全正确,但屏幕实际显示的“正常选择”(Arrow)、“链接选择”(Hand)、“忙碌”(Wait)、“后台运行”(AppStarting)等光标仍然是 Windows 经典样式。

本项目提供一个无需管理员权限的临时修复:读取当前用户所选方案中全部 14 个受支持光标角色(Arrow、Hand、Wait、AppStarting 等)的文件,通过 Windows 官方 SetSystemCursor API 将它们重新装载到当前登录会话,并可通过一个常驻后台进程在 Windows 重新初始化光标后自动恢复。

已复现环境

其他 Windows 11 构建也可能出现相同现象,但尚未验证。

症状

调查结论

已确认的事实:

  1. 光标包安装成功,文件和注册表路径均正确。
  2. Windows 当前会话中的 OCR_NORMAL、OCR_HAND、OCR_WAIT 等系统光标槽位内容仍是经典样式,与注册表指定文件不一致。
  3. 直接调用 SetSystemCursor 后,系统光标与注册表指定文件的像素内容完全一致,屏幕显示立即恢复正常。
  4. 该装载问题不只发生在登录时:会话中途 Windows 也会偶尔重新执行“注册表 -> 系统光标槽位”的装载,并再次把 OCR_NORMAL 等槽位载成经典样式。

因此,问题发生在“注册表方案 -> 当前登录会话的系统光标槽位”这一装载环节,而不是光标文件损坏或安装路径错误;且一次性应用无法长期保持,需要常驻进程在每次被还原后自动重新应用。

目前没有证据表明微软已公开确认该问题。它可能与 Insider 构建中的光标初始化、辅助功能指针设置或传统控制面板方案兼容性回归有关,具体内部原因仍待确认。

使用方法

方法一:直接双击

  1. 先通过 Windows 设置或 main.cpl 选择所需的自定义光标方案。
  2. 双击 Apply-CurrentCursorScheme.cmd。
  3. 所有已配置的光标角色应立即变为当前方案中的样式。

不要使用“以管理员身份运行”。脚本必须在日常登录账户下执行,才能读取正确的 HKEY_CURRENT_USER。

方法二:从 PowerShell 运行

powershell.exe -NoProfile -ExecutionPolicy Bypass -File ".\Apply-CurrentCursorScheme.ps1"

自动运行

一次性运行只作用于当前时刻;Windows 在会话中途重新初始化光标后,已修复的角色(尤其是 Arrow)可能再次被还原。推荐注册静默启动项,让后台进程在整个登录会话期间持续保持修复。

方法一:注册静默启动项(推荐)

  1. 先通过 Windows 设置或 main.cpl 选择所需的自定义光标方案。
  2. 双击 Register-CursorSchemeStartup.cmd。
  3. 之后每次登录都会在后台静默修复:登录约 3 秒后首次应用全部光标角色,约 25 秒后再次应用,随后进程常驻后台,每 10 秒自动重新应用一次,会话中途 Windows 重新初始化光标后会在数秒内自动恢复。
  4. 双击 Unregister-CursorSchemeStartup.cmd 可随时移除。

注册的内容是当前用户启动文件夹(shell:startup)中的一个快捷方式,指向本目录的 CursorSchemeStartup-Launcher.vbs,由它以隐藏窗口方式运行 CursorSchemeStartup-Worker.ps1。该进程会在整个登录会话期间常驻,并按固定间隔重新读取注册表并重新应用,因此在 main.cpl 中切换方案后也会自动跟随。全程不显示任何窗口,不需要管理员权限。运行日志写在 %TEMP%\CursorSchemeStartup.log,每次登录覆盖写入。

请始终在本目录保存这些文件;移动或删除脚本后,启动项会因找不到文件而失效。

方法二:手动创建快捷方式

  1. 按 Win + R。
  2. 输入 shell:startup 并回车。
  3. 在打开的启动文件夹中创建 Apply-CurrentCursorScheme.cmd 的快捷方式。

这种方式在每次登录时只会应用一次,且会短暂闪现一个控制台窗口;如果希望持续保持修复且完全无窗口,请使用方法一。

脚本行为

Apply-CurrentCursorScheme.ps1 只执行以下操作:

  1. 读取 HKEY_CURRENT_USER\Control Panel\Cursors 中 14 个受支持的光标角色(Arrow、Hand、Wait、AppStarting 等)。
  2. 展开路径里的 %SYSTEMROOT% 等环境变量。
  3. 检查 .cur/.ani 文件是否存在。
  4. 使用 LoadCursorFromFileW 加载光标。
  5. 使用 SetSystemCursor 替换当前会话中对应的全部系统光标槽位(OCR_NORMAL、OCR_HAND、OCR_WAIT、OCR_APPSTARTING 等 14 项)。

方案中未配置(注册表值为空)的角色会被跳过;某个角色失败不会阻止其他角色应用,但脚本最后会以错误退出并列出失败的角色。

脚本不会修改注册表,不会下载文件,也不需要管理员权限。

CursorSchemeStartup-Worker.ps1 在登录后自动运行上述脚本:先在约 3 秒和 28 秒各应用一次(覆盖 Windows 登录后的两次光标初始化),随后进入监视模式,默认每 10 秒从注册表重新应用一遍(可通过 -WatchIntervalSeconds 调整)。它使用命名互斥锁防止多实例同时运行,日志只在状态变化和每 30 分钟心跳时写入,避免刷屏。

恢复方法

可以使用任意一种方式恢复:

已知限制

参考资料

windows-cursor-scheme-fix (Arcadeq/windows-cursor-scheme-fix)

troubleshooting
Searching Database…

What is this?A PowerShell workaround for a Windows 11 bug: custom mouse cursor themes are installed correctly, but the screen stays stuck on the classic Windows Aero cursors. It reloads all 14 cursor roles into the live session and can keep re-applying them from a background process.
How do I apply the fix?Select your scheme in Windows Settings or main.cpl, then double-click Apply-CurrentCursorScheme.cmd (or run it from PowerShell) - cursors switch immediately. Run it from your normal account: 'Run as administrator' breaks the per-user registry read.
Do I need admin rights or anything else installed?No admin rights and nothing to install - it is plain PowerShell calling Windows' own SetSystemCursor and LoadCursorFromFileW APIs. The script never writes the registry and never downloads anything; it only reloads cursors into your current session.
Are there cursors it can't fix?NWPen, Person and Pin have no SetSystemCursor slots and cannot be fixed. Roles not set in your scheme are skipped, and if a cursor file fails to load the rest still apply but the script exits with an error listing the failures.
Which Windows versions does it work on?Windows only. The author reproduced the bug on Windows 11 25H2 (Insider Beta, build 26220.9223) with third-party .cur packs like Jepri Creations; other builds may be affected but are unverified.
Why do my cursors keep reverting even after I fix them?It is not your setup: Windows occasionally re-runs the step that loads the registry scheme into the live cursor slots, resetting them to the classic style mid-session. The author found no sign Microsoft has publicly acknowledged the bug and suspects a regression around cursor initialization in Insider builds, accessibility pointer settings, or legacy control panel scheme compatibility.
What does the background worker do once registered?It applies all cursor roles about 3 seconds after login and again roughly 25 seconds later, covering Windows' two post-login cursor initializations, then keeps re-reading the registry and re-applying every 10 seconds (adjustable via -WatchIntervalSeconds). A named mutex blocks duplicate instances, and it writes CursorSchemeStartup.log in your %TEMP% folder.
How do I get the default Windows cursors back?Open main.cpl and apply the Windows default scheme - with the startup entry registered, the resident worker follows the switch automatically. Logging off and back on also restores defaults, as long as the silent startup entry has been removed.
Creator
Arcadeq
Size
<0.1 MB
Stars
149
Updated
CommitSep 03
Age
1mo
Commits · 90 Days