@echo off
if exist ipconfig.txt del ipconfig.txt
ipconfig /all >ipconfig.txt
if exist phyaddr.txt del phyaddr.txt
find "Physical Address" ipconfig.txt >phyaddr.txt
for /f "skip=2 tokens=12" %%M in (phyaddr.txt) do set Mac=%%M
if exist IPAddr.txt del IPaddr.txt
find "IP Address" ipconfig.txt >IPAddr.txt
for /f "skip=2 tokens=15" %%I in (IPAddr.txt) do set IP=%%I
arp -s %IP% %Mac%

del ipaddr.txt
del ipconfig.txt
del phyaddr.txt

exit
这是1,另存为:1 .b a t
@echo off
arp -s 192.168.*.*(网关 IP) 00-00-00-00-00-00(网关 mac)
exit
这是2,另存为2.bat
好了,两个bat都写好了,现在是运用,我喜欢用注册表开机执行1.bat,喜欢用开机vbs执行2.bat,分开运行,保证你客户机这块的绑定100%成功!
注册表这一块:
w i ndows Registry Editor Version 5.00
[H K E Y_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"a r p"="C: \1 . b a t"
VBS这一块:
W s c r i p t.sleep 1000
dim oshell
set oshell = CreateObject("WScript.Shell")
oshell.run ("\ \1 9 2.168.*.*\ v b s\2.b.at") ————————服务器共享那个2.bat