Windows 11 Sysprep + disable OneDrive Startup for all users

Sherezade Fraile Paniagua 1 Reputation point
2025-02-24T14:40:02.1433333+00:00

We want to disable from sysprep the automatic windows startup for all users, but we can't find the option, does anyone know how to do it without anyone having logged in to the machine?

OneDrive Management
OneDrive Management
OneDrive: A Microsoft file hosting and synchronization service.Management: The act or process of organizing, handling, directing or controlling something.
1,368 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Emi Zhang-MSFT 28,056 Reputation points Microsoft Vendor
    2025-02-25T02:11:44.8433333+00:00

    Hi,

    To disable automatic startup for all users without anyone logging in, you can modify the registry settings during the sysprep process. Here are the steps:

    Open the Registry Editor:

    • Press Win + R, type regedit, and press Enter.

    Navigate to the following key:

       HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
    

    Modify or create the following DWORD values:

    • AutoAdminLogon: Set this to 0 to disable automatic login.
    • DefaultUserName: Ensure this is blank or set to a non-existent user.
      • DefaultPassword: Ensure this is blank.
      Save and exit the Registry Editor.

    Run sysprep:

    • Use the command sysprep /generalize /oobe /shutdown to prepare the system.

    This should prevent any user from being automatically logged in after the system restarts. Just checking in to see if the information was helpful. Please let us know if you would like further assistance.


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Sherezade Fraile Paniagua 1 Reputation point
    2025-02-26T12:06:01.2066667+00:00

    Finally it works with another reg key

    from cmd we add the reg:

    reg add "HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\OneDrive" /v DisableFileSyncNGSC /t REG_DWORD /d 1 /f

    Restart and close the syspreg


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.