@ECHO OFF
rem https://lazyadmin.nl/office-365/deploying-microsoft-teams-client/
rem https://www.onmsft.com/how-to/how-to-clear-your-microsoft-teams-cache-on-windows-10
setlocal enabledelayedexpansion
SET ERRORLEVEL
VERIFY > NUL
echo Go to https://www.microsoft.com/en-us/microsoft-teams/download-app and click on "Download Teams" button first.
echo You can leave the file in the %USERPROFILE%\Downloads.
@ECHO ON
%localappdata%\Microsoft\Teams\Update.exe --uninstall -s
IF ERRORLEVEL 1 GOTO :EOF
rd /Q /S %localappdata%\Microsoft\Teams
IF ERRORLEVEL 1 GOTO :EOF
%USERPROFILE%\Downloads\Teams_windows_x64.exe
IF ERRORLEVEL 1 GOTO :EOF
:EOF
EXIT /B !ERRORLEVEL!
Based on
https://lazyadmin.nl/office-365/deploying-microsoft-teams-client/
See also Scandisk
Do you notice that sometimes you can’t login to Microsoft Teams?
I have figure out that this happens after it automatically updates itself.
I have written a little script for me to overcome this issue.