芭啦啦能量 大佬有话说 :
同样的命令为什么WIN10用不了。!
https://mjjzp.cf/img/2020/12/04/0f03bedb02176.png
WIN7又没问题!!
@echo off
for /f "tokens=2 delims==" %%1 in (‘assoc .doc’)do (
for /f "tokens=2 delims==" %%2 in (‘ftype %%1’)do (
for %%3 in (%%2)do (if not defined p set p=%%~dp3
)
)
)
cd %p%
cscript ospp.vbs /sethst:kms.03k.org
获取office路径,KMS激活
Mortttttty 大佬有话说 :
不是 已经给你 提示了吗, 文件 路径 不对 ,你看看你的执行路径子在哪 ,相对 文件的路径 ,不对就改改 路径:)
芭啦啦能量 大佬有话说 :
win10 可以另类方法运行
start /d %p% cscript ospp.vbs /sethst:kms.03k.org
不过这样没法兼容WIN7,好烦,
ABCHINA 大佬有话说 :
win就这几个大版本,获取一下判断就完事
嗷嗷 大佬有话说 :
你可以先判断Win7/Win10再执行不同的命令
嗷嗷 大佬有话说 :
echo 操作系统版本:
ver|findstr /r /i " [版本 5.1.*]" > NUL && goto WindowsXP
ver|findstr /r /i " [版本 6.1.*]" > NUL && goto Windows7
ver | find "5.2." > NUL &&goto win2003
ver | find "6.2." > NUL &&goto win8
ver | find "6.3." > NUL &&goto win8.1
ver | find "10.0" > NUL &&goto win10
芭啦啦能量 大佬有话说 :
嗷嗷 大佬有话说 : 2020-12-4 17:39
妙啊,妙不可言
seafood_to 大佬有话说 :
。。。用HEU_KMS_Activator吧你要的功能都有
芭啦啦能量 大佬有话说 :
嗷嗷 大佬有话说 : 2020-12-4 17:39
@echo off
set OsVersion=0
ver|findstr /r /i "5.1.*" > NUL && goto Server2003winxp
ver|findstr /r /i "5.2.*" > NUL && goto Server2003winxp
ver|findstr /r /i "6.0.*" > NUL && goto Server2008win7
ver|findstr /r /i "6.1.*" > NUL && goto Server2008R2win7
ver|findstr /r /i "6.2.*" > NUL && goto Server2012win8
ver|findstr /r /i "6.3.*" > NUL && goto Server2012R2win8.1
ver|findstr /r /i "10.0.*" > NUL && goto Server2016win10
goto UnknownVersion
:Server2003winxp
set OsVersion="Windows Server 2003 for xp"
goto Show
:Server2008R2win7
set OsVersion="Windows Server 2008 for win7"
goto Show
:Server2008R2win7
set OsVersion="Windows Server 2008 R2 for win7"
goto Show
:Server2012win8
set OsVersion="Windows Server 2012 for win8"
goto Show
:Server2012R2win8.1
set OsVersion="Windows Server 2012 R2 for win8.1"
goto Show
:Server2016win10
set OsVersion="Windows Server 2016 for win10"
goto Show
:UnknownVersion
set OsVersion="UnknownVersion"
goto Show
:Show
echo %OsVersion%
pause
完善了一下,