zoukankan      html  css  js  c++  java
  • 卸载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 Office
    ootLicenses16ProPlusVL_KMS_Client-ppd.xrm-ms"
        cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft Office
    ootLicenses16ProPlusVL_KMS_Client-ul.xrm-ms"
        cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft Office
    ootLicenses16ProPlusVL_KMS_Client-ul-oob.xrm-ms"
        cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft Office
    ootLicenses16ProPlusVL_MAK-pl.xrm-ms"
        cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft Office
    ootLicenses16ProPlusVL_MAK-ppd.xrm-ms"
        cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft Office
    ootLicenses16ProPlusVL_MAK-ul-oob.xrm-ms"
        cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft Office
    ootLicenses16ProPlusVL_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 Office
    ootLicenses16ProjectProVL_KMS_Client-ppd.xrm-ms"
        cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft Office
    ootLicenses16ProjectProVL_KMS_Client-ul-oob.xrm-ms"
        cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft Office
    ootLicenses16ProjectProVL_KMS_Client-ul.xrm-ms"
        cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft Office
    ootLicenses16ProjectProVL_MAK-pl.xrm-ms"
        cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft Office
    ootLicenses16ProjectProVL_MAK-ppd.xrm-ms"
        cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft Office
    ootLicenses16ProjectProVL_MAK-ul-oob.xrm-ms"
        cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft Office
    ootLicenses16ProjectProVL_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 Office
    ootLicenses16VisioProVL_KMS_Client-ppd.xrm-ms"
        cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft Office
    ootLicenses16VisioProVL_KMS_Client-ul-oob.xrm-ms"
        cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft Office
    ootLicenses16VisioProVL_KMS_Client-ul.xrm-ms"
        cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft Office
    ootLicenses16VisioProVL_MAK-pl.xrm-ms"
        cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft Office
    ootLicenses16VisioProVL_MAK-ppd.xrm-ms"
        cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft Office
    ootLicenses16VisioProVL_MAK-ul-oob.xrm-ms"
        cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft Office
    ootLicenses16VisioProVL_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 Office
    ootLicenses16client-issuance-bridge-office.xrm-ms"
        cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft Office
    ootLicenses16client-issuance-root.xrm-ms"
        cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft Office
    ootLicenses16client-issuance-root-bridge-test.xrm-ms"
        cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft Office
    ootLicenses16client-issuance-stil.xrm-ms"
        cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft Office
    ootLicenses16client-issuance-ul.xrm-ms"
        cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft Office
    ootLicenses16client-issuance-ul-oob.xrm-ms"
        cscript "%windir%system32slmgr.vbs" /ilc "%~1Microsoft Office
    ootLicenses16pkeyconfig-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

     

     
  • 相关阅读:
    eBay要怎么转型?
    一张图让你看懂javascript各类型的关系
    闭包概念,匿名函数
    浅析Javascript闭包的特性
    深入理解JavaScript闭包(closure)
    深入理解JavaScript作用域和作用域链
    WPF 学习笔记(一)
    ChromiumWebBrowser flash不能自动播放问题解决方案
    饱含辛酸开发 WPF CustomControl
    KMP算法备忘
  • 原文地址:https://www.cnblogs.com/feipeng8848/p/7977184.html
Copyright © 2011-2022 走看看