技术解读

以下内容由 GitRead 中文社区 编辑团队基于项目 README 与官方资料整理, 结合中文开发者的常见使用场景补充技术选型建议。具体以项目官方文档为准。

WinJS-Microsoft-Account-Bypass 技术深度分析

GitHub 仓库 “the-P1neapple/WinJS-Microsoft-Account-Bypass” 提供了一种方法,在 Windows 11 的首次设置体验(Out-of-Box Experience, OOBE)过程中绕过 Microsoft 账户的强制要求。用户可以通过打开开发者控制台,触发一个隐藏的本地账户设置界面,进而完成仅凭本地账户的身份认证。这种线下操作适用于所有 Windows 11 版本,包括 S 模式,为用户提供了创建本地账户的便利。

项目背景与痛点

对于许多用户来说,安装 Windows 11 时强制连接 Microsoft 账户是一个令人头疼的问题。不仅复杂,还涉及到隐私和安全性的问题。尤其在企业环境中,绕开 Microsoft 账户的需求更为普遍。这个项目应运而生,提供了一个简洁且高效的解决方案,让用户能够绕过密码验证,直接创建本地账户。

核心技术揭秘

在技术架构层面,该项目利用了 Windows 系统的开发者模式。打开开发者控制台,通过特殊的指令调用隐藏的 API,从而启动本地账户的创建页面。以下是整个过程的架构图:

graph TD A[用户进入开发者模式] --> B{"检测当前模式"} B -->|"检测通过"| C[调用隐藏API] C --> D[显示本地账户设置界面] B -->|"检测失败"| E[返回错误提示]

该方案采用了一种巧妙的绕路设计,通过API直接调用本地账户设置界面,而非传统的引导用户一路通过原生OOBE界面输入Microsoft账户信息。这种方式不仅便捷,也规避了Microsoft账户系统的一些安全限制,使本地账户的创建过程更为简化。

功能亮点与差异

与其他方法相比,该项目的优势在于其为用户提供了一个直接且稳定的解决方案来创建本地账户,无需经过繁琐的设置步骤。另一个关键点是,它同适用于所有Windows 11的版本,甚至包括S模式。此外,项目提供了一种高度灵活的调用方式,开发者可以直接在脚本或自动化工具中运用此功能,进行批量部署和管理。

应用场景与落地建议

尽管这种方法极大地简化了安装设置过程,但它也存在一定的风险和限制。用户在启用开发者模式和调用隐藏API时,务必确保操作系统更新至最新版本,尽可能消除潜在的安全隐患。适合于需要快速部署本地账户的环境,比如刷机、批量部署等场景。值得注意的是,使用这种方法必须遵守最终用户许可协议,并了解操作可能带来的潜在风险,如系统安全性和数据隐私问题。

综合评价

该项目成功地解决了在安装 Windows 11 过程中必须注册 Microsoft 账户的痛点,提供了绕过这种方式进行本地账户创建的技术方案。其独特之处在于使用开发者模式调用隐藏的 API 接口,绕过了 Microsoft 账户的强制要求,是一种简洁而高效的方法。然而,它同时也带来了潜在的系统风险与安全挑战。通过合理的使用和细致的风险评估,WinJS-Microsoft-Account-Bypass 将是开发者与企业在某些特定场景下的有效工具。

关于

GitHub 原始描述(英文)

The WinJS-Microsoft-Account-Bypass repo offers a method to skip the Microsoft Account requirement during Windows 11 OOBE. By accessing the Developer Console, users can trigger a hidden local account setup screen. This offline technique works across all Windows 11 versions, including S-Mode, allowing local account creation.

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

贡献者

README

WinJS-Microsoft-Account-Bypass

Overview

This guide explains a method to bypass the Microsoft Account (MSA) requirement during the Windows 11 Out-Of-Box Experience (OOBE) by using the Developer Console to invoke a hidden local account setup screen. This method was discovered by examining the Windows 11 OOBE source code, which revealed an event listener for a hidden _localAccountButton.

[!NOTE] This method still works in the October 2025 Preview that blocked most methods for Local Accounts on OOBE including start ms-cxh://localonly.
The method I have documented is still the only known method for S-Mode installations.

Following these steps, you can create a local account without needing to sign in with or create a Microsoft account.

I also have a Youtube Tutorial that follows the same instructions below

Local Account Setup Screen

Steps to Bypass Microsoft Account Setup

1. Start Windows 11 Setup

  • Begin the Windows 11 Setup Process.
  • Select your region and keyboard layout.

2. Stop at the Secondary Keyboard Layout Screen

  • When you reach the Secondary Keyboard Layout screen, do not click Skip.
  • If you accidentally skipped and reached the Network Setup Screen, don’t stress. I have a guide in the troubleshooting section.

3. Open the Developer Console

  • Press Ctrl + Shift + J to open the Developer Console.
  • Your screen will go dark and will appear with a prompt (indicated by a > symbol) at the top left of the screen.

Note: If you can’t open the console, troubleshooting steps are below.

4. Enter the Restart Command

  • Type the following command exactly as shown:
    WinJS.Application.restart("ms-cxh://LOCALONLY")
    

Note: This command is case-sensitive. You can use Tab-completion to help:

  • After typing WinJS.A, press Tab to auto-complete Application.
  • After typing res, press Tab to auto-complete restart.

5. Exit the Developer Console

  • After entering the command, press Enter to execute it.
  • Press Escape to exit the Developer Console and return to the OOBE interface.

Note: If the Escape key doesn’t close the Console, click anywhere on the screen to ensure the console is focused and then press the key again.

6. Local Account Setup

  • The Secondary Keyboard Layout screen will refresh, and a Windows 10-style local account setup screen will appear.
  • Enter your desired username, password, and security questions and click Next.

7. Complete the Setup

  • The Setup will go black and will then log you in to your newly created account. Allow Windows 11 a few moments to configure the user.
  • Continue with the remaining privacy setting prompts.
  • Once finished, you will have successfully created a local account in Windows 11.

Troubleshooting

  • Error when entering the command:
    • Ensure the command is typed exactly as shown, including the case-sensitive parts. Use Tab-completion for accuracy.
    • Make sure the device is disconnected from the internet before running the command.

Developer Console Prompt

  • Developer Console not opening:

    • If the Console does not appear, try to click outside of the white setup box to focus away from the setup options and try again.
    • If the Console still does not open, Microsoft may have patched this out. :(
  • I am stuck on a loading screen:

    • If you do not see anything load after entering the command, you may have entered the URI (the text inside the brackets) incorrectly.
    • The safest way to get back to normal is to restart your computer by holding down the power button.
    • You can also restart the computer using Command Prompt or restart the Setup Application, you can find methods for these elsewhere.
  • I am stuck on the Network Setup or Microsoft Experience screens:

    • You can either restart the computer to go back to the beginning of the install process (recommended).
    • Alternatively, you can connect to the internet and open the Developer Console on the “Name this Device” or the “Unlock your Microsoft Experience” screens (not recommended).
    • If you are here after a failed attempt of the OOBE\BYPASSNRO method, you would likely be at the “Unlock your Microsoft Experience” screen, you can still open the Developer Console here.

    Note: If you are on a Microsoft Account Login Screen (prompting for email), The Developer Console is blocked. Restart your device if you cannot go back to the “Unlock your Microsoft Experience” screen.

Technical Details

  • The hidden _localAccountButton is referenced in the js/errorHandler.js file on line 31, where an event listener triggers the local account creation process when a local account button is pressed on an error screen.
  • The command used by the button, WinJS.Application.restart("ms-cxh://LOCALONLY"), forces the OOBE to restart and runs a simple local account setup flow.

Additional Notes for Sysadmins

  • You can open the Developer Console from any screen of the OOBE, with the exception of the Network Connection Screen and the Microsoft Account Login screens. You can open the Developer Console from the Region Select Screen if you wish, but keep in mind that all default region settings are applied.
  • This method is compatible with all Windows 11 versions to date, including 24H2 (Tested compatible on 26100.1742). There is a chance this could be compatible with Windows 10; do so at your own risk, as this has not been tested.
  • This method should be compatible with all editions of Windows 11 as the Developer Console is embedded into the OOBE itself and does not rely on any external programs. Yes S-Mode users, this is compatible with you too.

评论

暂无评论