卸载office密钥的命令
生活随笔
收集整理的這篇文章主要介紹了
卸载office密钥的命令
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1,管理員運行CMD或者PowerShell
2,轉到2016安裝目錄,C:Program FilesMicrosoft OfficeOffice16,這是64位的,32位的在C:Program Files (x86)。
3,先運行cscript ospp.vbs /dstatus 顯示已安裝KEY的狀態,這里只顯示KEY的后5位。
4,把要卸載的KEY用命令cscript ospp.vbs /unpkey:XXXXX(KEY后5位)卸載。
5,安裝KEY則是:cscript ospp.vbs /inpkey:(完整KEY)
附:office2016 版本轉換
::code: s1ave77, ratzlefatz
::[site:forums.mydigitallife.info]
::===============================================================================================================
@echo off
::===============================================================================================================
:: GET ADMIN RIGHTS
(NET FILE||(powershell -command Start-Process '%0' -Verb runAs -ArgumentList '%* '&EXIT /B))>NUL 2>&1
::===============================================================================================================
call :TITLE
setlocal ENABLEDELAYEDEXPANSION
pushd "%~dp0"
cd %~dp0
set ospp=OfficeSoftwareProtectionProduct
set osps=OfficeSoftwareProtectionService
set slp=SoftwareLicensingProduct
set sls=SoftwareLicensingService
set spp=SoftwareProtectionProduct
:================================================================================================================
::===============================================================================================================
for /f "tokens=2 delims==" %%A IN ('"wmic path %sls% get version /format:list"') do set version=%%A
for /f "tokens=6 delims=[]. " %%G in ('ver') do set win=%%G
if %win% lss 9200 (
call :NotSupported
goto:Exit
)
:================================================================================================================
::===============================================================================================================
:: OFFICE FIXITs
:OfficeConvert
cls
pushd %~dp0
call :HEADER "CONVERT OFFICE", ""
echo [O] OFFICE 16
echo [P] PROJECT 16
echo [V] VISIO 16
echo:
echo [A] ACTIVATE ONLINE
echo:
echo [B] BACK
call :FOOTER
CHOICE /C OPVAB /N /M "YOUR CHOICE ?"
if %errorlevel%==1 goto :Office16
if %errorlevel%==2 goto :Project16
if %errorlevel%==3 goto :Visio16
if %errorlevel%==4 goto :ActOnline
if %errorlevel%==5 goto:Exit
::===============================================================================================================
:: OFFICE FIXITs
:Office16
cls
pushd %~dp0
if "%mo16a%"=="" set "mo16a=x86"
call :HEADER "CONVERT OFFICE 16", ""
echo Set Office Architechture, e.g x64 or x86
echo Default: %mo16a%
call :FOOTER
set /p mo16a=Set Office Architechture ^>
cls
call :HEADER "CONVERTING OFFICE 16", ""
if "%mo16a%"=="x64" (
call :ConvertOffice16 "%programfiles%"
call :ConvertGeneral16 "%programfiles%"
)
if "%mo16a%"=="x86" (
call :ConvertOffice16 "%programfiles(x86)%"
call :ConvertGeneral16 "%programfiles%(x86)"
)
call :HEADER "CONVERTING OFFICE 16", ""
cscript "%windir%system32slmgr.vbs" /upk 7a0560c5-21ed-4518-ad41-b7f870b9fd1a
cscript "%windir%system32slmgr.vbs" /upk 39a1be8c-9e7f-4a75-81f4-21cfac7cbecb
cscript "%windir%system32slmgr.vbs" /upk 70d9ceb6-6dfa-4da4-b413-18c1c3c76e2e
cscript "%windir%system32slmgr.vbs" /upk c8ce6adc-ede7-4ce2-8e7b-c49f462ab8c3
call :HEADER "CONVERTING OFFICE 16", ""
call :OfficeGVLKInstall "%sls%", "XQNVK-8JYDB-WJ9W3-YJ8YR-WFG99"
call :FOOTER
pause
goto:OfficeConvert
:================================================================================================================
::===============================================================================================================
:Project16
cls
pushd %~dp0
if "%mp16a%"=="" set "mp16a=x86"
call :HEADER "CONVERT PROJECT 16", ""
echo Set Project Architechture, e.g x64 or x86
echo Default: %mp16a%
call :FOOTER
set /p mp16a=Set Project Architechture ^>
cls
call :HEADER "CONVERTING PROJECT 16", ""
if "%mp16a%"=="x64" (
call :ConvertProject16 "%programfiles%"
)
if "%mp16a%"=="x86" (
call :ConvertProject16 "%programfiles(x86)%"
)
call :HEADER "CONVERTING OFFICE 16", ""
cscript "%windir%system32slmgr.vbs" /upk aeedf8f7-8832-41b1-a9c8-13f2991a371c
cscript "%windir%system32slmgr.vbs" /upk ca5b3eea-c055-4acf-bc78-187db21c7db5
call :HEADER "CONVERTING PROJECT 16", ""
call :OfficeGVLKInstall "%sls%", "YG9NW-3K39V-2T3HJ-93F3Q-G83KT"
call :FOOTER
pause
goto:OfficeConvert
:++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
::++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
:Visio16
cls
pushd %~dp0
if "%mv16a%"=="" set "mv16a=x86"
call :HEADER "CONVERT VISIO 16", ""
echo Set Visio Architechture, e.g x64 or x86
echo Default: %mv16a%
call :FOOTER
set /p mv16a=Set Visio Architechture ^>
cls
call :HEADER "CONVERTING VISIO 16", ""
if "%mv16a%"=="x64" (
call :ConvertVisio16 "%programfiles%"
)
if "%mv16a%"=="x86" (
call :ConvertVisio16 "%programfiles(x86)%"
)
call :HEADER "CONVERTING VISIO 16", ""
cscript "%windir%system32slmgr.vbs" /upk 5821ec16-77a9-4404-99c8-2756dc6d4c3c
cscript "%windir%system32slmgr.vbs" /upk a17f9ed0-c3d4-4873-b3b8-d7e049b459ec
call :HEADER "CONVERTING VISIO 16", ""
call :OfficeGVLKInstall "%sls%", "PD3PC-RHNGV-FXJ29-8JK7D-RJRJK"
call :FOOTER
pause
goto:OfficeConvert
:++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
::++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
:ActOnline
cls
pushd %~dp0
set "kmsport=1688"
if "%kmshost%"=="" set "kmshost=x86"
if "%oversion%"=="" set "oversion=O"
call :HEADER "CONVERT VISIO 16", ""
echo Set Host Adress
echo Default: %kmshost%
echo:
echo Set Version: O =Office, P =Project, V =VISIO
echo Default: %oversion%
call :FOOTER
set /p kmshost=Set Host Adress ^>
set /p oversion=Set Version ^>
cls
call :HEADER "ACTIVATING ONLINE", ""
call :OfficeHostAndPort "%sls%"
if "%oversion%"=="O" call :OfficeActLoop "%slp%", "d450596f-894d-49e0-966a-fd39ed4c4c64", "Office 16"
if "%oversion%"=="P" call :OfficeActLoop "%slp%", "4f414197-0fc2-4c01-b68a-86cbb9ac254c", "Project 16"
if "%oversion%"=="V" call :OfficeActLoop "%slp%", "6bf301c1-b94a-43e9-ba31-d494598c47fb, "Visio 16"
call :FOOTER
pause
goto:OfficeConvert
:================================================================================================================
::===============================================================================================================
::CONVERT 16
:ConvertOffice16
cls
call :HEADER "Office 2016 Professional Plus x86 found", ""
cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft OfficeootLicenses16ProPlusVL_KMS_Client-ppd.xrm-ms"
cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft OfficeootLicenses16ProPlusVL_KMS_Client-ul.xrm-ms"
cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft OfficeootLicenses16ProPlusVL_KMS_Client-ul-oob.xrm-ms"
cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft OfficeootLicenses16ProPlusVL_MAK-pl.xrm-ms"
cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft OfficeootLicenses16ProPlusVL_MAK-ppd.xrm-ms"
cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft OfficeootLicenses16ProPlusVL_MAK-ul-oob.xrm-ms"
cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft OfficeootLicenses16ProPlusVL_MAK-ul-phn.xrm-ms"
call :FOOTER
timeout /t 3
goto:eof
::===============================================================================================================
:ConvertProject16
cls
call :HEADER "Project 2016 Professional Plus x86 found", ""
cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft OfficeootLicenses16ProjectProVL_KMS_Client-ppd.xrm-ms"
cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft OfficeootLicenses16ProjectProVL_KMS_Client-ul-oob.xrm-ms"
cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft OfficeootLicenses16ProjectProVL_KMS_Client-ul.xrm-ms"
cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft OfficeootLicenses16ProjectProVL_MAK-pl.xrm-ms"
cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft OfficeootLicenses16ProjectProVL_MAK-ppd.xrm-ms"
cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft OfficeootLicenses16ProjectProVL_MAK-ul-oob.xrm-ms"
cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft OfficeootLicenses16ProjectProVL_MAK-ul-phn.xrm-ms"
call :FOOTER
timeout /t 3
goto:eof
::===============================================================================================================
:ConvertVisio16
cls
call :HEADER "Visio 2016 Professional Plus x86 found", ""
cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft OfficeootLicenses16VisioProVL_KMS_Client-ppd.xrm-ms"
cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft OfficeootLicenses16VisioProVL_KMS_Client-ul-oob.xrm-ms"
cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft OfficeootLicenses16VisioProVL_KMS_Client-ul.xrm-ms"
cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft OfficeootLicenses16VisioProVL_MAK-pl.xrm-ms"
cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft OfficeootLicenses16VisioProVL_MAK-ppd.xrm-ms"
cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft OfficeootLicenses16VisioProVL_MAK-ul-oob.xrm-ms"
cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft OfficeootLicenses16VisioProVL_MAK-ul-phn.xrm-ms"
call :FOOTER
timeout /t 3
goto:eof
::===============================================================================================================
:ConvertGeneral16
cls
call :HEADER "Office 2016 Professional Plus x86 found", ""
cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft OfficeootLicenses16client-issuance-bridge-office.xrm-ms"
cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft OfficeootLicenses16client-issuance-root.xrm-ms"
cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft OfficeootLicenses16client-issuance-root-bridge-test.xrm-ms"
cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft OfficeootLicenses16client-issuance-stil.xrm-ms"
cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft OfficeootLicenses16client-issuance-ul.xrm-ms"
cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft OfficeootLicenses16client-issuance-ul-oob.xrm-ms"
cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft OfficeootLicenses16pkeyconfig-office.xrm-ms"
call :FOOTER
timeout /t 3
goto:eof
:++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
::++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
:OfficeGVLKInstall
wmic path %~1 where version='%version%' call InstallProductKey ProductKey="%~2" >nul 2>&1
if %errorlevel% equ 0 echo: & echo Successfully installed %~2. & echo:
if %errorlevel% neq 0 echo: & echo Installing %~2 Failed. & echo:
goto:eof
:++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
::++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
:OfficeActLoop
wmic path %~1 where ID='%~2' call Activate >nul 2>&1
if %errorlevel% equ 0 echo: & echo Successfully activated: %~3 Professional Plus.
if %errorlevel% neq 0 echo: & echo Activation Failed.
goto:eof
:++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
::++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
:OfficeHostAndPort
wmic path %~1 where version='%version%' call SetKeyManagementServiceMachine MachineName="%kmshost%" >nul 2>&1
if %errorlevel% equ 0 echo: & echo Successfully changed IP to %kmshost%. & echo:
if %errorlevel% neq 0 echo: & echo Setting IP to %kmshost% Failed.
wmic path %~1 where version='%version%' call SetKeyManagementServicePort %kmsport% >nul 2>&1
if %errorlevel% equ 0 echo: & echo Successfully changed Port to %kmsport%. & echo:
if %errorlevel% neq 0 echo: & echo Setting Port to %kmsport% Failed. & echo:
goto:eof
:++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
::++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
:NotSupported
cls
call :HEADER "Not supported: %ver% %vera% found!", " "
echo:
echo Operating System is not supported.
call :FOOTER
timeout /t 5
goto:eof
:++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
::++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
:HEADER
echo:
echo.
echo %~1
echo:%~2
echo.
echo:
goto:eof
:++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
::++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
:FOOTER
echo:
echo.
echo:
goto:eof
:++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
::++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
:TITLE
title ?Manual Office 16 Conversion ?
goto:eof
:++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
::++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
:Exit
endlocal
exit
goto:eof
:++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
:++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
復制以上代碼,新建txt文件,保存成xx.cmd。右鍵以管理員身份執行。
神奇的kms原理:https://03k.org/kms.html
搭建服務器:https://www.jianshu.com/p/3675bc117659
https://www.landiannews.com/archives/18526.html
?
總結
以上是生活随笔為你收集整理的卸载office密钥的命令的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: linux下写脚本时-gt或-lt是什么
- 下一篇: css3 forwards、backwa