w10install/optional/install-msoffice.cmd

57 lines
1.6 KiB
Batchfile
Raw Permalink Normal View History

2024-09-08 19:53:09 +02:00
@echo off
call check-for-admin
if %ERRORLEVEL% neq 0 exit /b
set T=%SystemDrive%\TEMP
set TOOLS=%SystemDrive%\tools
set CONFIG=config\office2019-standard.xml
set ARCHIVE=..\software\office2019-standard.7z
set STARTMENU="%PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs"
if NOT EXIST %ARCHIVE% (
echo ERROR: %ARCHIVE% not found!
exit /b
)
echo ####### %0 #######
echo unpacking office files ...
%TOOLS%\7z x -y -aoa -o%T% %ARCHIVE%
echo starting MS-Office setup ...
@echo on
%TOOLS%\officedeploymenttool.exe /configure %CONFIG%
@echo off
echo TEMP cleanup ...
rd /S /Q %T%\Office 2>nul
echo renaming folder in startmenu ...
move /Y %STARTMENU%\"Microsoft Office Tools" %STARTMENU%\"Microsoft Office" 2>nul
echo moving links in startmenu ...
move /Y %STARTMENU%\Word.lnk %STARTMENU%\"Microsoft Office" 2>nul
move /Y %STARTMENU%\Excel.lnk %STARTMENU%\"Microsoft Office" 2>nul
move /Y %STARTMENU%\PowerPoint.lnk %STARTMENU%\"Microsoft Office" 2>nul
echo installing desktop icons ...
copy /Y %STARTMENU%\"Microsoft Office\Word.lnk" %PUBLIC%\Desktop
copy /Y %STARTMENU%\"Microsoft Office\Excel.lnk" %PUBLIC%\Desktop
copy /Y %STARTMENU%\"Microsoft Office\PowerPoint.lnk" %PUBLIC%\Desktop
rem refresh desktop (W10 style)
ie4uinit.exe -show
echo cleaning startmenu ...
del /F /Q /A %STARTMENU%\"Microsoft Office\Telemetry*.lnk" 2>nul
del /F /Q /A %STARTMENU%\"Microsoft Office\Office Upload Center.lnk" 2>nul
echo ####### %0 #######
rem set filetypes ...
2024-09-10 23:26:49 +02:00
if EXIST ..\scripts\set-filetypes.cmd (
call ..\scripts\set-filetypes.cmd
)
2024-09-08 19:53:09 +02:00
pause