
We’ve Run Into an Issue Download Edge WebView2
I’ve been running into this issue repeatedly for a few clients lately, usually showing up as Microsoft Teams or OneDrive throwing a vague “We’ve run into an issue” message and prompting the user to download Edge WebView2. After fixing it manually more times than I care to admit, I finally got annoyed with the repetitiveness and decided to automate the fix into a single batch script you can run with a double click.
In most cases, reinstalling Teams or OneDrive does nothing. That’s because the underlying problem usually isn’t the app itself.
What’s Actually Breaking
In my experience, this issue almost always comes down to a broken or partially corrupted Microsoft Edge WebView2 runtime. WebView2 is a shared system-level component that Microsoft uses to render UI inside apps like Teams and OneDrive. When it’s missing, corrupted, or stuck in a bad state, multiple apps can fail in similar and confusing ways.
Common causes I’ve seen include:
Interrupted or failed WebView2 updates
Corrupted installer files
Pathing issues where WebView2 exists on disk but apps can’t resolve it correctly
Because WebView2 is installed separately from Teams and OneDrive, reinstalling those apps usually leaves the broken runtime untouched.
Why This Is Annoying to Fix Manually
One of the more frustrating parts of this issue is that WebView2 installs itself into a versioned folder under its application directory. The folder name is a numeric version string, for example 144.0.3719.82, and that version changes constantly as updates roll out.
That means:
You can’t reliably hardcode the path
The registry is not always trustworthy when the runtime is partially broken
The installer you need is buried under a version-specific folder
This is exactly the kind of problem that’s easy to fix once, but painful to repeat across multiple machines.
What the Script Does
This script is designed to fix the “We’ve Run Into an Issue” / “Download Edge WebView2” error in a repeatable way.
At a high level, it does three things:
Allows WebView2 to be repaired
It updates two registry values that control whether the Edge WebView2 runtime can be reinstalled or repaired.
In certain failure states, those flags prevent the installer from doing anything useful.
Automatically finds the installed WebView2 version
Instead of relying on the registry or hardcoded paths, the script locates the active WebView2 version folder directly on disk.
It identifies the numeric version directory dynamically, so it works regardless of the installed version.
Runs a proper system-level repair
It executes the correct
setup.exefrom the discovered version folder.This forces a clean, system-level repair install of the WebView2 runtime.
The end result is a repaired WebView2 runtime without having to uninstall Edge, reinstall Teams, or manually hunt through folders.
Usage Notes
The script must be run as administrator.
It will close Edge and WebView2 processes to avoid file locks.
It returns an exit code of
0when the repair completes successfully.It’s designed to be portable, you can drop it onto an affected machine and run it directly.
I’ve tried to keep this as universal as possible so it can be used across different systems without modification. If you do run into edge cases or failures in your environment, let me know, but this approach has been reliable for me and has saved a lot of repetitive cleanup work.
1@ECHO OFF2SETLOCAL ENABLEEXTENSIONS3setlocal enabledelayedexpansion4COLOR 095TITLE JOSHFRIDEY.COM WEBVIEWW2 FIX6:: --- Elevation Check ---7:: Check if script is running as admin (no redirection)8NET SESSION9IF %ERRORLEVEL% NEQ 0 (10 ECHO Requesting administrative privileges...11 PowerShell -Command "Start-Process '%~f0' -ArgumentList '/elevated' -Verb RunAs"12 EXIT /B13)14:: Check for elevation flag15IF "%1"=="/elevated" SHIFT16set "REGKEY=HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft EdgeWebView"17set "VALNAME=SystemComponent"18set "VALNAME2=NoRemove"19echo Setting %REGKEY% %VALNAME% to 0...20reg add "%REGKEY%" /v "%VALNAME%" /t REG_DWORD /d 0 /f21if errorlevel 1 (22 echo Failed to set registry value %VALNAME%.23)24reg add "%REGKEY%" /v "%VALNAME2%" /t REG_DWORD /d 0 /f25if errorlevel 1 (26 echo Failed to set registry value %VALNAME2%.27)28REM --- Determine WebView2 folder version from disk ---29set "APPROOT=C:\Program Files (x86)\Microsoft\EdgeWebView\Application"30set "RAW="31REM Find the only folder whose name contains only digits and dots, like 144.0.3719.8232for /d %%D in ("%APPROOT%\*") do (33 set "NAME=%%~nxD"34 set "TMP=!NAME!"35 REM Strip digits and dots36 for %%C in (0 1 2 3 4 5 6 7 8 9 .) do set "TMP=!TMP:%%C=!"37 REM If nothing remains, NAME was only digits and dots38 if "!TMP!"=="" (39 set "RAW=!NAME!"40 goto :FoundVersion41 )42)43 44:FoundVersion45Echo Version %RAW%46 47set "EXE=C:\Program Files (x86)\Microsoft\EdgeWebView\Application\!RAW!\Installer\setup.exe"48echo Stopping WebView2 and Edge processes..49taskkill /f /im msedgewebview2.exe50taskkill /f /im msedge.exe51start "" /wait "%EXE%" --msedgewebview --system-level --verbose-logging52set "EC=%ERRORLEVEL%"53echo WebView2 reinstall exit code: %EC%54ECHO === WEBVIEW2 FIX COMPLETE ===55ECHO Press any key to exit...56PAUSE57EXIT
You can contact my best friend and food provider with this form. Suggestions, corrections, and questions are always welcome! Please also message me French fries...
