0

我知道软件盗版是一种严重的犯罪。因此,我不会这样做。但是我遇到了一个使用密钥管理服务(KMS)激活方法激活 Office 2016 的脚本。

但我不完全确定这个脚本实际上是如何做到的。尤其是那些涉及 >nul 的行

编辑:我的疑问是程序中的那些 for 循环和 cscripts 做了什么。正如用户所说,如果将它们复制到当前目录中的一个文件夹中,为什么要这样做?

是否会删除与产品许可证验证相关的文件?

来源:https ://www.youtube.com/watch?v=Dq5khDs9ofk

@echo off
title Activate Microsoft Office 2016 ALL versions for FREE!&cls&echo ============================================================================
&echo #Project: Activating Microsoft software products for FREE without software&echo ============================================================================
&echo.&echo #Supported products:&echo - Microsoft Office Standard 2016&echo - Microsoft Office Professional Plus 2016&echo.&echo.

&(if exist "%ProgramFiles%\Microsoft Office\Office16\ospp.vbs" cd /d "%ProgramFiles%\Microsoft Office\Office16")
&(if exist "%ProgramFiles(x86)%\Microsoft Office\Office16\ospp.vbs" cd /d "%ProgramFiles(x86)%\Microsoft Office\Office16")

&(for /f %%x in ('dir /b ..\root\Licenses16\proplusvl_kms*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul)
&(for /f %%x in ('dir /b ..\root\Licenses16\proplusvl_mak*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul)
&echo.&echo ============================================================================

&echo Activating your Office...&cscript //nologo ospp.vbs /unpkey:WFG99 >nul&cscript //nologo ospp.vbs /unpkey:DRTFM >nul
&cscript //nologo ospp.vbs /unpkey:BTDRB >nul
&cscript //nologo ospp.vbs /unpkey:CPQVG >nul
&cscript //nologo ospp.vbs /inpkey:XQNVK-8JYDB-WJ9W3-YJ8YR-WFG99 >nul&set i=1
:server
if %i%==1 set KMS_Sev=kms4.MSGuides.com
if %i%==2 set KMS_Sev=kms5.MSGuides.com
if %i%==3 set KMS_Sev=kms6.MSGuides.com
if %i%==4 goto notsupported
cscript //nologo ospp.vbs /sethst:%KMS_Sev% >nul
&echo ============================================================================&echo.&echo.
cscript //nologo ospp.vbs /act | find /i "successful" && (echo.&echo ============================================================================&echo.&echo 
#My official blog: MSGuides.com&echo.&echo
#How it works: bit.ly/kms-server&echo.&echo 
#Please feel free to contact me at msguides.com@gmail.com if you have any questions or concerns.&echo.&echo 
#Please consider supporting this project: donate.msguides.com&echo
 #Your support is helping me keep my servers running everyday!&echo.&echo ============================================================================
 &choice /n /c YN /m "Would you like to visit my blog [Y,N]?" & if errorlevel 2 exit) || (echo The connection to my KMS server failed! Trying to connect to another one... 
 & echo Please wait... & echo. & echo. & set /a i+=1 & goto server)
explorer "http://MSGuides.com"&goto halt
:notsupported
echo.&echo ============================================================================&echo Sorry! Your version is not supported.&echo Please try installing the latest version here: bit.ly/getmsps
:halt
pause
4

1 回答 1

2

我假设您指的是这些行:

&(for /f %%x in ('dir /b ..\root\Licenses16\proplusvl_kms*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul)
&(for /f %%x in ('dir /b ..\root\Licenses16\proplusvl_mak*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul)

在这种情况下,以下是每个部分的作用:

for /f %%x in ('dir /b ..\root\Licenses16\proplusvl_kms*.xrm-ms')

针对以下路径运行dir /b命令行工具(仅列出文件名)..\root\Licenses16\proplusvl_kms*.xrm-ms'

  1. 当前目录上一个文件夹
  2. root此文件夹中的文件夹
  3. proplusvl_kms*.xrm-ms与此文件夹中的模式匹配的所有文件名

对于这些文件中的每一个,运行以下命令:

cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul

cscript是一个 Windows 命令,用于执行 Visual Basic 脚本文件 (vbs)。在每次迭代中,%%x替换为上一个dir命令结果中的相应值(这是一个文件名)。如此有效,这将作为参数值ospp.vbs传入(大概脚本可以理解)。..\root\Licenses16\[file name from 'dir']/inslic

只是将>nul输出重定向到无处而不是打印到屏幕上。

于 2017-05-29T14:01:29.943 回答