@color c
@cls
@echo [ComputersMAC] [Name] [ip] >name.xmz
@echo 74-27-EA-34-02-CBA01111>>name.xmz
@echo 74-27-EA-16-50-18A02112>>name.xmz
@cls
ipconfig /all >ipconfig.xmz
find "Physical Address" ipconfig.xmz >mac.xmz
for /f "skip=1 tokens=12" %%C in (mac.xmz) do set mac=%%C
find "%mac%" name.xmz >key.xmz
for /f "skip=1 tokens=2" %%C in (key.xmz) do set name=%%C
for /f "skip=1 tokens=3" %%C in (key.xmz) do set ip=%%C
@echo %name%
@echo %ip%
@echo Windows Registry Editor Version 5.00 >Cname.reg
@echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName] >>Cname.reg
@echo "ComputerName"="%name%" >>Cname.reg
@echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters] >>Cname.reg
@echo "NV Hostname"="%name%" >>Cname.reg
@echo "Hostname"="%name%" >>Cname.reg
@echo Windows Registry Editor Version 5.00 >insn.reg
@echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters] >>insn.reg
@echo "VirtualNetworkNumber"=dword:00000%name% >>insn.reg
@echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NwlnkIpx\Parameters] >>insn.reg
@echo "VirtualNetworkNumber"=dword:00000%name% >>insn.reg
regedit /s Cname.reg
regedit /s insn.reg
netsh interface ip set address name="本地连接" source=static addr=192.168.7.%ip% mask=255.255.255.0 gateway=192.168.7.1 gwmetric=0
netsh interface ip set dns name="本地连接" source=static addr=202.99.192.68
netsh interface ip add dns name="本地连接" addr=202.99.192.66 index=2
del /q *.xmz
del /q *.reg
shutdown -r -t 5
del %0