1.Install Kms Windows&Office.bat

限未加入域的電腦使用


@echo off
color 71
echo ====================================================================
echo *   Install  GVLK Microsoft Licenses    *
echo     只適用以下作業系統:Windows7   Windows10
echo     只適用以下Office 2010,2013,2016 標準版及專業版
echo     只適用標準映像檔安裝
echo     己加入域的電腦請勿使用,若使用,每 180 天需要請您再執行一次認證程序
echo     安裝OEM的電腦前,請用微軟的TOOLS先移除內建的OFFICE版本
echo ====================================================================
echo.
echo. 1.Microsoft Windows7/10 Install Juteng-Intl GVLK Microsoft Licenses
echo.
echo. 2.Microsoft Office 2010 Install Juteng-Intl GVLK Microsoft Licenses
echo.
echo. 3.Microsoft Office 2013 Install Juteng-Intl GVLK Microsoft Licenses
echo.
echo. 4.Microsoft Office 2016 Install Juteng-Intl GVLK Microsoft Licenses
echo.
echo.
set KMS_Server=10.40.1.9
set /p c=請選擇要安裝的版本:
if %c%==1 goto 1
if %c%==2 goto 2
if %c%==3 goto 3
if %c%==4 goto 4
:office
setlocal EnableDelayedExpansion
reg query %strRegKey% >nul 2>nul
if %errorlevel%==0 (set strCurrentKey=%strRegKey%) else (set strCurrentKey=%strRegKey6432%)
for /f "delims=" %%i in ('reg query %strCurrentKey%') do (
set strInstPath=%%i
set strInstPath=!strInstPath:*REG_SZ=!
)
:LTrim
if "%strInstPath:~0,1%"==" " set "strInstPath=%strInstPath:~1%" && goto LTrim
:RTrim
if "%strInstPath:~-1%"==" " set "strInstPath=%strInstPath:~0,-1%" && goto RTrim
if "%strInstPath:~-1%" neq "\" set strInstPath=%strInstPath%\
echo office installation path %strInstPath%
cd /d %strInstPath%
cscript ospp.vbs /sethst:%KMS_Server%
cscript ospp.vbs /act
pause
exit
:1
cscript "%SystemRoot%\system32\slmgr.vbs" /skms %KMS_Server%
cscript "%SystemRoot%\system32\slmgr.vbs" -ato
pause
:2
set "strRegKey=HKEY_LOCAL_MACHINE\Software\Microsoft\Office\14.0\Common\InstallRoot /v Path"
set "strRegKey6432=HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Office\14.0\Common\InstallRoot /v Path"
goto office

:3
set "strRegKey=HKEY_LOCAL_MACHINE\Software\Microsoft\Office\15.0\Common\InstallRoot /v Path"
set "strRegKey6432=HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Office\15.0\Common\InstallRoot /v Path"
goto office

:4
set "strRegKey=HKEY_LOCAL_MACHINE\Software\Microsoft\Office\16.0\Common\InstallRoot /v Path"
set "strRegKey6432=HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Office\16.0\Common\InstallRoot /v Path"
goto office
pause
exit

留言

這個網誌中的熱門文章

我的商家-建立簡稱及名稱

2.Install Kms Windows10 Pro Public Key.bat