求斑竹或高手帮忙写一端修改内部网络号的批处理
echo off
ipconfig /all | find /I "IP Address">IP_.txt
for /f "tokens=15" %%M in (IP_.txt) do set IP=%%M
echo REGEDIT4 >reg.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\NwlnkIpx\Parameters] >>reg.reg
echo "VirtualNetworkNumber"=dword:00000%IP:~10% >>reg.reg
regedit /s reg.reg
del IP_.txt
del reg.reg
论坛提倡这种DIY精神。鄙视那些纯粹要代码的作者: anqing 时间: 2006-11-25 05:23 @echo off
color c
echo ┌————————————————————┐
echo ┆网吧自动改IP.计算机名.cscdkey.ipx (beta)┆
echo ┆QQ25969805 ┆
echo └————————————————————┘
echo the config.txt format is(ip_name_mac_netmask_netgate_dns_dns2_cscdkey_ipx)
echo get physical address...
ipconfig /all | find "Physical Address" >%temp%\mac.txt
for /f " tokens=12" %%i in (%temp%\mac.txt) do set mymac=%%i
echo physical address is %mymac%
for /f "skip=2 tokens=2" %%i in (%temp%\mac.txt) do set mymac=%%i
echo name %mymac%
for /f "skip=2 tokens=1" %%i in (%temp%\mac.txt) do set mymac=%%i
echo ip address %mymac%
for /f "skip=2 tokens=4" %%i in (%temp%\mac.txt) do set mymac=%%i
echo netmask %mymac%
for /f "skip=2 tokens=5" %%i in (%temp%\mac.txt) do set mymac=%%i
echo gateway %mymac%
for /f "skip=2 tokens=6" %%i in (%temp%\mac.txt) do set mymac=%%i
echo dns %mymac%
for /f "skip=2 tokens=7" %%i in (%temp%\mac.txt) do set mymac=%%i
echo dns2 %mymac%
for /f "skip=2 tokens=8" %%i in (%temp%\mac.txt) do set mymac=%%i
echo cscdkey %mymac%
for /f "skip=2 tokens=9" %%i in (%temp%\mac.txt) do set mymac=%%i
echo ipx %mymac%
echo unlock reg...
echo Windows Registry Editor Version 5.00 >%temp%\1.reg
echo [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System] >>%temp%\1.reg
echo "DisableRegistryTools"=dword:00000000 >>%temp%\1.reg
reg import %temp%\1.reg
echo change name...
for /f "skip=2 tokens=2" %%i in (%temp%\mac.txt) do set mymac=%%i
echo Windows Registry Editor Version 5.00 >%temp%\1.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName] >>%temp%\1.reg
echo "ComputerName"="%mymac%" >>%temp%\1.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters] >>%temp%\1.reg
echo "NV Hostname"="%mymac%" >>%temp%\1.reg
echo "Hostname"="%mymac%" >>%temp%\1.reg
regedit /s %temp%\1.reg
echo change ipx...
for /f "skip=2 tokens=9" %%i in (%temp%\mac.txt) do set mymac=%%i
echo Windows Registry Editor Version 5.00 >%temp%\1.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters] >>%temp%\1.reg
echo "VirtualNetworkNumber"=dword:00000%mymac% >>%temp%\1.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NwlnkIpx\Parameters] >>%temp%\1.reg
echo "VirtualNetworkNumber"=dword:00000%mymac% >>%temp%\1.reg
regedit /s %temp%\1.reg
echo change cscdkey...
for /f "skip=2 tokens=8" %%i in (%temp%\mac.txt) do set mymac=%%i
echo Windows Registry Editor Version 5.00 >%temp%\1.reg
echo [HKEY_CURRENT_USER\Software\Valve\CounterStrike\Settings]>>%temp%\1.reg
echo "Key"="%mymac%">>%temp%\1.reg
regedit /s %temp%\1.reg
echo change ip address...
echo it will be take a Minutes times please wait...
for /f "skip=2 tokens=1" %%i in (%temp%\mac.txt) do set mymac=%%i
for /f "skip=2 tokens=4" %%i in (%temp%\mac.txt) do set mymac1=%%i
for /f "skip=2 tokens=5" %%i in (%temp%\mac.txt) do set mymac2=%%i
for /f "skip=2 tokens=6" %%i in (%temp%\mac.txt) do set mymac3=%%i
for /f "skip=2 tokens=7" %%i in (%temp%\mac.txt) do set mymac4=%%i
netsh interface ip set address name="本地连接" source=static addr=%mymac% mask=%mymac1% gateway=%mymac2% gwmetric=0
netsh interface ip set dns name="本地连接" source=static addr=%mymac3% register=PRIMARY
netsh interface ip add dns name="本地连接" addr=%mymac4% index=2
del %temp%\1.reg /q
del %temp%\mac.txt /q
shutdown /r /t 30
pause
shutdown /a
exit