secowu 发表于 2019-4-26 23:39

@echo off

    rem author : 默然King
    title Office 2019 专业增强版下载安装脚本
   cd /d "%~dp0"
    color 1f
    set Source=

    echo.
    echo ---------------------------------------------------------
    echo   请选择产品授权通道
    echo ---------------------------------------------------------
    echo   1=零售版 Retail
    echo   2=批量授权 Volume
    echo   3=退出脚本
    echo ---------------------------------------------------------
    echo.

    choice /n /c 123 /m "请选择"
    if errorlevel==3 exit
    if errorlevel==2 set "Product=Volume" && goto :Menu
    if errorlevel==1 set "Product=Retail" && goto :Menu

    :Menu
    cls & echo.

    echo ---------------------------------------------------------
    echo   请选择任务
    echo ---------------------------------------------------------
    echo   1=在线安装 Office 2019
    echo   2=离线安装 Office 2019
    echo   3=在线安装 Office 2019 并保留安装文件
    echo   4=下载 Office 2019 安装文件
    echo   5=退出脚本
    echo ---------------------------------------------------------
    echo.

    choice /n /c 12345 /m "请选择"
    if errorlevel==5 exit
    if errorlevel==4 goto :Download
    if errorlevel==3 goto :Online
    if errorlevel==2 goto :Offline
    if errorlevel==1 goto :Install

    :Install
    cls & echo.

    if /i "%PROCESSOR_IDENTIFIER:~0,3%"=="x86" (
    set "bit=32"
    goto :StartI
      )

    echo ---------------------------------------------------------
    echo   请选择需要安装的版本
    echo ---------------------------------------------------------
    echo   1=X64
    echo   2=X86
    echo   3=退出脚本
    echo ---------------------------------------------------------
    echo.

    choice /n /c 123 /m "请选择"
    if errorlevel==3 exit
    if errorlevel==2 set "bit=32" && goto :StartI
    if errorlevel==1 set "bit=64" && goto :StartI

    :StartI
    cls & echo.

    echo ---------------------------------------------------------
    echo正在安装 Office 2019 专业增强版 %bit% 位版本,请等待完成。
    echo ---------------------------------------------------------

    call :Config
    "%~dp0setup.exe" /configure "%~dp0configuration.xml" || goto :Error
    goto :Close

    :Offline
    cls & echo.

    echo ---------------------------------------------------------
    set /p "Source=请输入 Office 安装文件路径,路径中不包含引号。(即使路径中包含空格):"
    goto :Install

    :Download
    cls & echo.
    set "Source=%cd%"

    echo ---------------------------------------------------------
    echo   请选择需要下载的版本
    echo ---------------------------------------------------------
    echo   1=X64
    echo   2=X86
    echo   3=退出脚本
    echo ---------------------------------------------------------
    echo.

    choice /n /c 123 /m "请选择"
    if errorlevel==3 exit
    if errorlevel==2 set "bit=32" && goto :StartD
    if errorlevel==1 set "bit=64" && goto :StartD

    :StartD
    cls & echo.

    echo ---------------------------------------------------------
    echo正在下载 Office 2019 %bit% 位版本,请等待完成。
    echo ---------------------------------------------------------
    call :Config
    "%~dp0setup.exe" /download "%~dp0configuration.xml" || goto :Null
    goto :end

    :Online
    cls & echo.
    set "Source=%cd%"
    if /i "%PROCESSOR_IDENTIFIER:~0,3%"=="x86" (
    set "bit=32"
    goto :Start
      )

    echo ---------------------------------------------------------
    echo   请选择需要安装的版本
    echo ---------------------------------------------------------
    echo   1=X64
    echo   2=X86
    echo   3=退出脚本
    echo ---------------------------------------------------------

    echo.
    choice /n /c 123 /m "请选择"
    if errorlevel==3 exit
    if errorlevel==2 set "bit=32" && goto :Start
    if errorlevel==1 set "bit=64" && goto :Start

    :Start
    cls & echo.

    echo ---------------------------------------------------------
    echo正在安装 Office 2019 专业增强版 %bit% 位版本,请等待完成。
    echo ---------------------------------------------------------

    call :Config
    "%~dp0setup.exe" /download "%~dp0configuration.xml" || goto :Null
    "%~dp0setup.exe" /configure "%~dp0configuration.xml" || goto :Error
    goto :Close

    :Close
    cls & echo.

    echo ---------------------------------------------------------
    echoOffice 2019 安装完成,按任意键退出!
    echo ---------------------------------------------------------
    pause >nul
    del /s /q configuration.xml >nul 2>nul
    exit

    :end
    cls & echo.

    echo ---------------------------------------------------------
    echo下载完成, Office 2019 安装文件已保存在: "%Source%" 目录。
    echo按任意键退出!
    echo ---------------------------------------------------------
    pause >nul
    del /s /q configuration.xml >nul 2>nul
   exit

    :Error
    cls & echo.

    echo ---------------------------------------------------------
    echo   Office 2019 安装失败,按任意键退出脚本!
    echo ---------------------------------------------------------
    pause >nul
    del /s /q configuration.xml >nul 2>nul
    exit

    :Null
    cls & echo.

    echo ---------------------------------------------------------
    echo   Office 2019 下载失败,按任意键退出脚本!
    echo ---------------------------------------------------------
    pause >nul
    del /s /q configuration.xml >nul 2>nul
    exit

    :Config
    del /s /q configuration.xml >nul 2>nul

    rem下面是配置脚本,若要下载其它版本/组件/语言,请自行编辑下面的内容。
    rem参考网页: https://docs.microsoft.com/en-us/deployoffice/configuration-options-for-the-office-2016-deployment-tool

    > "%~dp0configuration.xml" (
echo       ^<Configuration^>
echo       ^<Add SourcePath="%Source%" OfficeClientEdition="%bit%"^>
echo       ^<Product ID="ProPlus2019%Product%"^>
echo       ^<Display AcceptEULA="TRUE" /^>
echo       ^<Language ID="zh-cn" /^>
echo       ^<Language ID="zh-tw" /^>
echo       ^<Language ID="en-us" /^>
echo       ^</Product^>
echo       ^<Product ID="ProjectPro2019Volume"^>
echo       ^<Language ID="zh-CN" /^>
echo       ^<Language ID="zh-tw" /^>
echo       ^<Language ID="en-us" /^>
echo       ^<ExcludeApp ID="OneDrive" /^>
echo       ^</Product^>
echo       ^<Product ID="VisioPro2019Volume"^>
echo       ^<Language ID="zh-CN" /^>
echo       ^<Language ID="zh-tw" /^>
echo       ^<Language ID="en-us" /^>
echo       ^<ExcludeApp ID="OneDrive" /^>
echo       ^</Product^>
echo       ^</Add^>
echo       ^</Configuration^>
echo.
      )
    goto :eof

    remecho       ^<ExcludeApp ID="Access" /^>
    remecho       ^<ExcludeApp ID="Groove" /^>
    remecho       ^<ExcludeApp ID="OneDrive" /^>
    remecho       ^<ExcludeApp ID="InfoPath" /^>
    remecho       ^<ExcludeApp ID="Lync" /^>
    remecho       ^<ExcludeApp ID="Outlook" /^>
    remecho       ^<ExcludeApp ID="Project" /^>
    remecho       ^<ExcludeApp ID="Publisher" /^>
    remecho       ^<ExcludeApp ID="SharePointDesigner" /^>

okxing 发表于 2019-4-27 10:04

cxwm 发表于 2019-4-27 13:11

这个好东西啊,感谢分享啊!

wbq163 发表于 2019-4-27 16:05

谢谢你的分享

Dcbivk 发表于 2019-4-27 16:25

谢谢LZ分享

Dcbivk 发表于 2019-4-27 16:28

谢谢LZ分享

zyccb 发表于 2019-4-27 17:04


感谢分享,谢谢。{:5_262:}

梦之秋韵 发表于 2019-4-27 21:00

谢谢楼主分享!!!

lightpath 发表于 2019-4-28 08:40

下载试试,谢谢

FRF1511 发表于 2019-4-28 09:05

一直想换个新版本试试,正好用这个了,感谢分享好东西。

shinobirj 发表于 2019-4-28 13:01

感谢楼主分享支持

楍楍 发表于 2019-4-29 07:07


谢谢楼主分享,谢谢!!

mengqing 发表于 2019-4-29 16:22

谢谢楼主分享!

皮逗 发表于 2019-4-29 21:35

多谢楼主分享

guangzhizi0000 发表于 2019-4-29 23:02

xxfen享。。。。。。。。

druze 发表于 2019-4-30 08:18

谢谢分享!试试先!

qqwjq 发表于 2019-4-30 10:13

感谢分享

xu16810 发表于 2019-4-30 10:17

谢谢分享,看看

xu16810 发表于 2019-4-30 10:19

谢谢分享。

高原天马 发表于 2019-4-30 10:23

谢谢分享!
页: 1 2 [3] 4 5 6 7 8 9 10 11 12
查看完整版本: 下载与安装