-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathUninstallOffice2011.sh
More file actions
64 lines (55 loc) · 3 KB
/
UninstallOffice2011.sh
File metadata and controls
64 lines (55 loc) · 3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
# Meza Hsu
# May 13, 2016
# Based on https://support.office.com article titled: Troubleshoot Office 2011 for Mac issues by completely uninstalling before you reinstall
# Attempt to Quit Office Applications prior to removal
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'
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'
osascript -e 'tell application "Microsoft Outlook.app" to quit'
# Step 1: Remove the Microsoft Office 2011 folder
/bin/rm -R /Applications/Microsoft\ Office\ 2011/
# Step 2: Remove preference and license files and Office folder
/bin/rm /Users/$3/Library/Preferences/com.microsoft.Excel.plist
/bin/rm /Users/$3/Library/Preferences/com.microsoft.office.plist
/bin/rm /Users/$3/Library/Preferences/com.microsoft.office.setupassistant.plist
/bin/rm /Users/$3/Library/Preferences/com.microsoft.outlook.databasedaemon.plist
/bin/rm /Users/$3/Library/Preferences/com.microsoft.outlook.office_reminders.plist
/bin/rm /Users/$3/Library/Preferences/com.microsoft.Outlook.plist
/bin/rm /Users/$3/Library/Preferences/com.microsoft.PowerPoint.plist
/bin/rm /Users/$3/Library/Preferences/com.microsoft.Word.plist
/bin/rm /Users/$3/Library/Preferences/ByHost/com.microsoft.*
/bin/rm /Library/LaunchDaemons/com.microsoft.office.licensing.helper.plist
/bin/rm /Library/Preferences/com.microsoft.office.licensing.plist
/bin/rm /Library/PrivilegedHelperTools/com.microsoft.office.licensing.helper
# Step 3: Remove Microsoft folders and Office 2011 files
/bin/rm -R /Library/Application\ Support/Microsoft/
/bin/rm -R /Library/Fonts/Microsoft/
/bin/rm /Library/Receipts/Office2011_*
# Step 4: Rename and optionally remove Microsoft User Data folder
# perform this step at your own risk of losing user data
# /bin/rm -R /Users/$3/Documents/Microsoft\ User\ Data/
# Step 5: Empty Trash and restart
# no need
# Step 6: Remove Office application icons
/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
# Misc. Remove Related Legacy Apps, Automator Actions & Sharepoint Plug-In
rm -R '/Applications/Microsoft Communicator.app/'
rm -R '/Applications/Microsoft Messenger.app/'
rm -R '/Applications/Remote Desktop Connection.app/'
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/Internet\ Plug-Ins/SharePoint*
exit 0