How to run WebView2 Application on system startup when UAC is enabled

ajay.shinde 20 Reputation points
2026-08-18T12:46:41.0766667+00:00
  • We have developed a C++ application which starts on system startup. This is configured through 'Winlogon/shell' registry value. UAC is configured as enable on the system.
  • 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

Answer accepted by question author
Damien Pham (WICLOUD CORPORATION) 2,055 Reputation points Microsoft External Staff Moderator
2026-08-19T02:33:11.24+00:00

Hello @ajay.shinde ,

For this design, the supported direction is to keep the WebView2-hosting C# process in the interactive user's standard, non-elevated security context. The WebView2 security guidance recommends hosting WebView2 in a standard, non-elevated user-integrity process, and User Account Control creates both a standard user access token and an administrator access token when an administrator signs in. So with UAC enabled, you should not need a separate standard user account only to obtain a standard token.

The practical approach is: if the C++ Winlogon\Shell launcher is already running with the standard token, start the C# WebView2 process with normal CreateProcess. If the launcher is running with the elevated administrator token, query the linked standard token with GetTokenInformation using TokenLinkedToken / TOKEN_LINKED_TOKEN, then start the WebView2 process with that real linked token using CreateProcessAsUser or CreateProcessWithTokenW. Avoid creating a hand-restricted token by stripping privileges or SIDs, because WebView2 uses a Chromium multi-process model and the runtime must be able to create its browser, renderer, and helper processes, as described in the WebView2 process model.

Also make sure the WebView2 process is launched in the interactive desktop/session and uses a writable per-user user data folder, for example under %LocalAppData%. If the app still shows a white screen after launching with the real linked standard token, the next useful data is the exact EnsureCoreWebView2Async / CoreWebView2InitializationCompleted exception and HRESULT, plus verbose webview2.log, because that will show whether msedgewebview2.exe is failing during environment/controller creation.

Hope this helps clarify things. 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?

1 person found this answer helpful.

0 additional answers

Sort by: Most 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.