Rick0

OFFICE_LICENCA

Mar 11th, 2020 (edited)
544
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 2.80 KB | None | 0 0
  1. @ECHO OFF
  2. setlocal EnableDelayedExpansion
  3. pushd "%~dp0"
  4. SET "X86=%PROGRAMFILES%\Microsoft Office\Office16\ospp.vbs"
  5. SET "X64=%PROGRAMFILES(x86)%\Microsoft Office\Office16\ospp.vbs"
  6. if not "%1"=="am_admin" ("%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\powershell.exe" start -verb runas '%0' am_admin & exit /b)
  7. popd
  8. TITLE ATIVANDO OFFICE 2019 Aguarde...
  9. ECHO ATIVANDO OFFICE 2019 Aguarde...
  10. ::ENCERRANDO PROCESSOS
  11. SET "KILL=EXCEL.EXE,POWERPNT.EXE,WINWORD.EXE"
  12. for %%i in (%KILL%) do (
  13. tasklist | find /i "%%i" && taskkill /im "%%i" /F 2>nul &CLS)
  14.  
  15. IF EXIST "%X86%" (GOTO 32BITS)
  16. IF EXIST "%X64%" (GOTO 64BITS)
  17.  
  18. :32BITS
  19.  
  20. TITLE ATIVANDO Office19ProPlus2019 32 bits
  21. ECHO ATIVANDO Office19ProPlus2019 32 bits Aguarde...
  22. FOR %%d in ("%X86%") do SET "APPDIR32=%%~dpd"
  23. cd "%APPDIR32%" & SET "cmd=cscript ospp.vbs"
  24. %cmd% /dstatus | findstr /i "Office19ProPlus2019VL"
  25. if not "%errorlevel%" EQU 0 (for /f %%x in ('dir /b ..\root\Licenses16\ProPlus2019VL*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x")
  26. %cmd% /setprt:1688 >nul & %cmd% /unpkey:6MWKP >nul & %cmd% /inpkey:NMMKJ-6RK4F-KMJVX-8D9MJ-6MWKP >NUL & %cmd% /sethst:s8.uk.to & %cmd% /act & %cmd% /dstatus
  27. echo.
  28. ::2. ProjectPro
  29. TITLE ATIVANDO OFFICE ProjectPro 2019 32 bits Aguarde...
  30. ECHO ATIVANDO OFFICE ProjectPro2019 32 bits Aguarde...
  31. %cmd% /dstatus | findstr "Office19ProjectPro2019VL"
  32. if not "%errorlevel%" EQU 0 (for /f %%x in ('dir /b ..\root\Licenses16\ProjectPro2019VL*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x")
  33. %cmd% /setprt:1688 >nul & %cmd% /setprt:1688 >nul & %cmd% /unpkey:PKD2B >nul & %cmd% /inpkey:NB4NPR-3FKK7-T2MBV-FRQ4W-PKD2B >NUL & %cmd% /sethst:s8.uk.to & %cmd% /act & %cmd% /dstatus
  34. GOTO END
  35.  
  36. :64BITS
  37. ::1. ProPlus
  38. TITLE ATIVANDO Office19ProPlus2019 64 bits Aguarde...
  39. ECHO ATIVANDO Office19ProPlus2019 Aguarde...
  40. FOR %%d in ("%X64%") do SET "APPDIR64=%%~dpd"
  41. cd "%APPDIR64%" & SET "cmd=cscript ospp.vbs"
  42. %cmd% /dstatus | findstr /i "Office19ProPlus2019VL"
  43. if not "%errorlevel%" EQU 0 (for /f %%x in ('dir /b ..\root\Licenses16\ProPlus2019VL*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x")
  44. %cmd% /setprt:1688 >nul & %cmd% /unpkey:6MWKP >nul & %cmd% /inpkey:NMMKJ-6RK4F-KMJVX-8D9MJ-6MWKP >NUL & %cmd% /sethst:s8.uk.to & %cmd% /act & %cmd% /dstatus
  45. echo.
  46. ::2. ProjectPro
  47. TITLE ATIVANDO OFFICE ProjectPro 2019 64 bits
  48. ECHO ATIVANDO OFFICE ProjectPro2019 AGUARDE...
  49. cd "%APPDIR64%" & SET "cmd=cscript ospp.vbs"
  50. %cmd% /dstatus | findstr /i "Office19ProjectPro2019VL"
  51. if not "%errorlevel%" EQU 0 (for /f %%x in ('dir /b ..\root\Licenses16\ProjectPro2019VL*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x")
  52. %cmd% /setprt:1688 >nul & %cmd% /unpkey:PKD2B >nul & %cmd% /inpkey:NB4NPR-3FKK7-T2MBV-FRQ4W-PKD2B >NUL & %cmd% /sethst:s8.uk.to & %cmd% /act & %cmd% /dstatus
  53. GOTO END
  54.  
  55. :END
  56. EXIT
Add Comment
Please, Sign In to add comment