How to run WebView2 Application on system startup

ajay.shinde 0 Reputation points
2026-07-23T05:30:59.1233333+00:00
  • We have developed a C++ application which starts on system startup. This is configured through 'Winlogon/shell' registry value.
  • CPP application on launch spawns a C#,WebView2 application. However it fails to execute or shows white screen issues. We understand this is due to running WebView2 application in admin/privileged mode.
  • We can not create new user with standard privileges or we can not use 'explorer.exe' that establishes runtime environment for WebView2 application. These are our environment restrictions.
  • Through ShellLauncherV2 approach also we need new standard user available, thus it can not be used as well.

Request to please suggest an approach where we can spawn C#,WebView2 application safely without any issue.

Thanks in advance.

Ajay Shinde

Microsoft Edge | Microsoft Edge development
0 comments No comments

2 answers

Sort by: Most helpful
  1. Muhammad Mujahid 0 Reputation points
    2026-07-31T07:30:44.83+00:00

    Hey Ajay,

    WebView2 usually breaks when launched from an elevated Winlogon shell.

    Try starting the C# process with a lower integrity level from your C++ launcher, or move it to a logon scheduled task that runs in the interactive user context. Both approaches often fix it.
    When you’re picking which one to test first, a quick ruleta aleatoria can help keep it simple.

    Was this answer helpful?


  2. Damien Pham (WICLOUD CORPORATION) 1,800 Reputation points Microsoft External Staff Moderator
    2026-07-23T07:04:58.3+00:00

    Hello @ajay.shinde ,

    Thank you for reaching out.

    Per Develop secure WebView2 apps, WebView2 cannot be run as a system user, and that restriction specifically blocks system/session-level scenarios (the doc calls out Credential Provider as an example). Launching your app through the Winlogon/Shell registry value runs it in the system logon context rather than an interactive standard-user session, so the WebView2 Runtime has no valid user profile/user-data-folder environment to initialize, which produces the failure and white screen you're observing.

    The same guidance also gives the supported direction: as a security best practice, the process hosting WebView2 should run at standard (non-elevated) user integrity, and any work requiring elevation should be isolated into a separate dedicated process while the WebView2 host stays de-elevated. In other words, the WebView2 UI needs to be created inside a logged-on standard-user session with an initialized user profile; running it under the system/Winlogon shell or elevated/admin context is not a supported configuration.

    Given your constraints (no new standard user, no explorer.exe, and ShellLauncherV2 ruled out), there isn't a supported way to host WebView2 directly in the system-level startup context. The reliable path is to keep your C++ launcher as the startup trigger but have the WebView2 app started within a standard interactive user session that has a user profile available, rather than from the system logon shell.

    If you can share whether the machine ever has an interactive standard-user session available at startup (for example an auto-logon standard user), I can help you map the launch flow to that supported model.

    I hope this helps. If you found my response helpful or informative, I would greatly appreciate it if you could follow this guidance or provide feedback.    

    Thank you.    

    Was this answer helpful?


Your answer

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