Find below the quick and efficient solution

No need to go to registry and seek for the hives to adjust their values.

  1. Use your favourite text or code editor and create new Powershell file type.
  2. The script can be used later on, anytime, when the Teams got stuck on its startup.
  3. Place the 3 lines of the code below and save the file having the file extension "ps1".

#$procid=get-process teams |select -expand id
taskkill /IM teams.exe /F
Remove-Item C:\Users\michal\AppData\Roaming\Microsoft\Teams\* -Recurse -Force

  • The first line of the script is commented but can get get the process ID of "teams" application for further use.
  • The second line kills the process running having the name of "teams" - no process id required, as usually there is multiple processes having the same name.
  • The third line recursively cleanup the files in specified folders and subfolders. The Force attribute is used not to be asking for any confirmation queries. Make sure, you updated the valid username in the Path specified.
  • Once the run of the script is finished, you can run the Teams application again, and now it starts swiftly without any hassle.