-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathMsOffice365_Install.cmd
More file actions
56 lines (47 loc) · 2.36 KB
/
MsOffice365_Install.cmd
File metadata and controls
56 lines (47 loc) · 2.36 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
::================================================================================================================
:: Install Microsoft Office 365
::================================================================================================================
@echo off
for /f "usebackq delims=" %%i in (`
powershell -NoProfile -ExecutionPolicy Bypass -Command "[System.IO.Path]::GetTempPath()"
`) do set "TempPath=%%i"
set "OfficeSetupFilePath=%TempPath%\setup.exe"
set "ConfigFilePath=%TempPath%\MsOfficeConfiguration.xml"
echo Downloading Office Deployment Tool ...
winget.exe install --exact --id Microsoft.OfficeDeploymentTool --location "%TempPath%" ^
--accept-source-agreements --accept-package-agreements --silent --disable-interactivity --source=winget
echo Creating the configuration file ...
:: Outlook (new) : OutlookForWindows
:: Outlook (classic) : Outlook | old/deprecated ?
:: OneDrive (Groove) : Groove | old/deprecated
:: Skype for Business : Lync | old/deprecated
:: Publisher : Publisher | old/deprecated
:: Some apps might no longer be included in the setup installer.
:: Comment the apps you want to install (i.e. Add :: at the beginning of the line).
(
echo ^<Configuration^>
echo ^<Add OfficeClientEdition="64" Channel="Current"^>
echo ^<Product ID="O365ProPlusRetail"^>
echo ^<Language ID="MatchOS" /^>
echo ^<ExcludeApp ID="Access" /^>
echo ^<ExcludeApp ID="Bing" /^>
:: echo ^<ExcludeApp ID="Excel" /^>
echo ^<ExcludeApp ID="Groove" /^>
echo ^<ExcludeApp ID="Lync" /^>
echo ^<ExcludeApp ID="OneDrive" /^>
echo ^<ExcludeApp ID="OneNote" /^>
echo ^<ExcludeApp ID="Outlook" /^>
echo ^<ExcludeApp ID="OutlookForWindows" /^>
:: echo ^<ExcludeApp ID="PowerPoint" /^>
echo ^<ExcludeApp ID="Publisher" /^>
echo ^<ExcludeApp ID="Teams" /^>
:: echo ^<ExcludeApp ID="Word" /^>
echo ^</Product^>
echo ^</Add^>
echo ^<Display AcceptEULA="TRUE" /^>
echo ^</Configuration^>
) > "%ConfigFilePath%"
echo Running Office setup ...
set "ArgumentList=/configure ""%ConfigFilePath%"""
powershell.exe -NoProfile -ExecutionPolicy Bypass -Command ^
"Start-Process -WindowStyle 'Hidden' -Verb 'RunAs' -FilePath '%OfficeSetupFilePath%' -ArgumentList '%ArgumentList%'"