Skip to main content
Solved

Force close new Teams work or School App

  • February 29, 2024
  • 5 replies
  • 51 views

Forum|alt.badge.img+8

Hello.

I'm trying to ensure teams is closed prior to updating app and getting errors when trying to force close it.

 

killall "Microsoft Teams (work or school).app"

 

Works fine with Classic teams i'm sure it's something about work or school part getting lost in code just don't know how to fix it.

 

Thank you for your time.

Best answer by chriso16

try AppleScript.. better than a kill:  (you may need to change the name here, don't have teams) 

 

#!/bin/sh osascript <<EOF try tell application "Microsoft Teams" quit end tell end try EOF

 


Sorry I replied to wrong post 

 

Thanks for pointing me in the right direction here is final script that worked

Quit Teams Classic if it's running
osascript -e 'quit app "Microsoft Teams (work or school)"'

Remove the Teams work or School app
rm -rf //Applications/Microsoft\\ Teams\\ \\(work\\ or\\ school\\).app

5 replies

jamf-42
Forum|alt.badge.img+17
  • Esteemed Contributor
  • February 29, 2024

try AppleScript.. better than a kill:  (you may need to change the name here, don't have teams) 

 

#!/bin/sh osascript <<EOF try tell application "Microsoft Teams" quit end tell end try EOF

 


AJPinto
Forum|alt.badge.img+26
  • Legendary Contributor
  • February 29, 2024

If you are using Microsoft's Teams package, the preinstall script in the package will quit teams for you without you needing to do anything else.


Forum|alt.badge.img+8
  • Author
  • Contributor
  • March 1, 2024

If you are using Microsoft's Teams package, the preinstall script in the package will quit teams for you without you needing to do anything else.


Thanks for replying. I do run the pkg but I've noticed since switch to the new teams version app crashes after install but if I fully remove the app then install seems to work better. I was able to script to remove the app just haven't figured out script to force close it as well.


Forum|alt.badge.img+8
  • Author
  • Contributor
  • March 1, 2024

If you are using Microsoft's Teams package, the preinstall script in the package will quit teams for you without you needing to do anything else.


Thanks for pointing me in the right direction here is final script that worked

Quit Teams Classic if it's running
osascript -e 'quit app "Microsoft Teams (work or school)"'

Remove the Teams work or School app
rm -rf //Applications/Microsoft\\ Teams\\ \\(work\\ or\\ school\\).app


Forum|alt.badge.img+8
  • Author
  • Contributor
  • Answer
  • March 1, 2024

try AppleScript.. better than a kill:  (you may need to change the name here, don't have teams) 

 

#!/bin/sh osascript <<EOF try tell application "Microsoft Teams" quit end tell end try EOF

 


Sorry I replied to wrong post 

 

Thanks for pointing me in the right direction here is final script that worked

Quit Teams Classic if it's running
osascript -e 'quit app "Microsoft Teams (work or school)"'

Remove the Teams work or School app
rm -rf //Applications/Microsoft\\ Teams\\ \\(work\\ or\\ school\\).app