Skip to content

Instantly share code, notes, and snippets.

@Cojad
Created November 24, 2016 05:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Cojad/7502d2064db0643ad5f809c7c72c6da5 to your computer and use it in GitHub Desktop.
Save Cojad/7502d2064db0643ad5f809c7c72c6da5 to your computer and use it in GitHub Desktop.
Remove Office 2011 completely
#!/bin/sh
# IMPORTANT!!!
# This script try to wipe out all office 2011 files but would also delete some other Microsoft files.
# So you are adviced to reinstall other microsoft product which not belong to office 2011.
osascript -e 'tell application "Microsoft Database Daemon" to quit'
osascript -e 'tell application "Microsoft AU Daemon" to quit'
osascript -e 'tell application "Office365Service" to quit'
#Closes all Office applications
osascript -e 'tell application "Microsoft Excel.app" to quit without saving'
osascript -e 'tell application "Microsoft PowerPoint.app" to quit without saving'
osascript -e 'tell application "Microsoft Word.app" to quit without saving'
/usr/local/bin/dockutil --remove 'Microsoft Word' --allhomes
/usr/local/bin/dockutil --remove 'Microsoft Outlook' --allhomes
/usr/local/bin/dockutil --remove 'Microsoft PowerPoint' --allhomes
/usr/local/bin/dockutil --remove 'Microsoft Excel' --allhomes
#Have to kill Outlook process to close any open drafted emails or it will fail
killall -kill "Microsoft Outlook"
rm -R '/Applications/Microsoft Communicator.app/'
rm -R '/Applications/Microsoft Lync.app/'
rm -R '/Applications/Microsoft Messenger.app/'
rm -R '/Applications/Microsoft Office 2011/'
rm -R '/Applications/Remote Desktop Connection.app/'
rm -R '/Library/Application Support/Microsoft/'
rm -R /Library/Automator/*Excel*
rm -R /Library/Automator/*Office*
rm -R /Library/Automator/*Outlook*
rm -R /Library/Automator/*PowerPoint*
rm -R /Library/Automator/*Word*
rm -R /Library/Automator/*Workbook*
rm -R '/Library/Automator/Get Parent Presentations of Slides.action'
rm -R '/Library/Automator/Set Document Settings.action'
rm -R /Library/Fonts/Microsoft/
mv '/Library/Fonts Disabled/Arial Bold Italic.ttf' /Library/Fonts
mv '/Library/Fonts Disabled/Arial Bold.ttf' /Library/Fonts
mv '/Library/Fonts Disabled/Arial Italic.ttf' /Library/Fonts
mv '/Library/Fonts Disabled/Arial.ttf' /Library/Fonts
mv '/Library/Fonts Disabled/Brush Script.ttf' /Library/Fonts
mv '/Library/Fonts Disabled/Times New Roman Bold Italic.ttf' /Library/Fonts
mv '/Library/Fonts Disabled/Times New Roman Bold.ttf' /Library/Fonts
mv '/Library/Fonts Disabled/Times New Roman Italic.ttf' /Library/Fonts
mv '/Library/Fonts Disabled/Times New Roman.ttf' /Library/Fonts
mv '/Library/Fonts Disabled/Verdana Bold Italic.ttf' /Library/Fonts
mv '/Library/Fonts Disabled/Verdana Bold.ttf' /Library/Fonts
mv '/Library/Fonts Disabled/Verdana Italic.ttf' /Library/Fonts
mv '/Library/Fonts Disabled/Verdana.ttf' /Library/Fonts
mv '/Library/Fonts Disabled/Wingdings 2.ttf' /Library/Fonts
mv '/Library/Fonts Disabled/Wingdings 3.ttf' /Library/Fonts
mv '/Library/Fonts Disabled/Wingdings.ttf' /Library/Fonts
rm -R /Library/Internet\ Plug-Ins/SharePoint*
rm -R /Library/LaunchDaemons/com.microsoft.office.licensing.helper.plist
rm -R /Library/Preferences/com.microsoft.office.licensing.plist
rm -R /Library/PrivilegedHelperTools/com.microsoft.office.licensing.helper
OFFICERECEIPTS=$(pkgutil --pkgs=com.microsoft.office.*)
for ARECEIPT in $OFFICERECEIPTS
do
pkgutil --forget $ARECEIPT
done
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment