Refreshing menu bar

mconners
Valued Contributor

All, I created a little script to remove an application from a computer and it works well. However, the icon for the application remains in the menu bar. Is there a way to refresh the menu bar? I am thinking almost like killing the dock and having it come back.

2 REPLIES 2

ggetenj
New Contributor II

You can kill the SystemUIServer which manages all System Menus:

/usr/bin/killall -9 SystemUIServer

mconners
Valued Contributor

Thank you @ggetenj I tried that but for some reason, the menu is refreshing but the icon isn't being removed. The app was launched using a LaunchAgent, which was force quit and removed. I might have to force the user to log out and have them log back in. This process does fix the icon issue.