源地址在这里。
Emulated KMS Servers on non-Windows platforms
http://forums.mydigitallife.info/threads/50234-Emulated-KMS-Servers-on-non-Windows-platforms
它同时提供了一个python版本。不受系统限制。可以安装在任意支持python(2.6 higher)的系统上。
把它放到Openwrt路由器里,实现自动对局域网内机器进行Windows,Office进行激活。注意,此脚本需要用掉大概12m内存。我用的360路由,显示占用10%内存。
点我下载:py-kms_2014-03-21T232943Z
解压后,重命名py-kms上传到Openwrt路由的/etc下,
启动命令:python /etc/py-kms/server.py 0.0.0.0 1688 & ##0.0.0.0表示接受任意地址发来的请求。 1688是kms的默认端口
更多参数可以参阅READ.ME
netstat -lntp ##1688端口起来了
root@OpenWrt:/etc# netstat -lntp
netstat: showing only processes with your user ID
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN 2921/smbd
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 2850/uhttpd
tcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN 4727/dnsmasq
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 2896/vsftpd
tcp 0 0 0.0.0.0:1688 0.0.0.0:* LISTEN 7231/python
接下来,在客户端测试KMS是否可用,下载KMS Client
点我下载:KMS Client
假设你的路由器地址是192.168.1.1
“KMS Client.exe” 1688 192.168.1.1 Windows
“KMS Client.exe” 1688 192.168.1.1 Office2010
“KMS Client.exe” 1688 192.168.1.1 Office2013
出现下列successful提示就表明成功了。Office类似。
“KMS Client.exe” 1688 192.168.1.1 Windows
KMS Port: 1688
KMS Host: 192.168.1.1
KMS Client Mode: WindowsKMS Client Emulator started successfully.
Successfully received response from KMS Server.
KMS Server PID: 06401-00206-271-872215-03-1033-9600.0000-3622013.
Activation request (KMS V4.0) 1 of 1 sent.
最后,就可以激活啦
激活Windows
进入c:/windows/system32
slmgr /skms 192.168.1.1:1688
slmgr /ato激活Office
cd C:\Program Files\Microsoft Office\Office15
cscript ospp.vbs /sethst:192.168.1.1
cscript ospp.vbs /act