本帖最后由 smartzbs 于 2011-1-19 15:17 编辑 ;set Ipx=0
$Ipx = 0
;for /f "tokens=15" %%i in ('ipconfig ^|find /i "ip address"') do set Ipx=%%i
For $i=1 To 4
$sIp = Execute("@IPAddress"&$i)
If $sIp = "0.0.0.0" Then ExitLoop
$Ipx = $sIp
Next
;set Ipx=%Ipx:~10%
;$Ipx = StringTrimLeft($Ipx, 10-1);本句是取第10个开始的字符,我估计它是要取最后一个段(D段),所以用下面代替
$Ipx = StringTrimLeft($Ipx, StringInStr($Ipx, ".", 0, -1))
;reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v "VirtualNetworkNumber" /t REG_DWORD /d %Ipx% /f
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters", "VirtualNetworkNumber", "REG_DWORD", $Ipx)
;reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NwlnkIpx\Parameters" /v "VirtualNetworkNumber" /t REG_DWORD /d %Ipx% /f
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NwlnkIpx\Parameters", "VirtualNetworkNumber", "REG_DWORD", $Ipx)
;snetcfg.exe -l %SystemRoot%\inf\netnwlnk.inf -c p -i MS_NWIPX
RunWait("snetcfg.exe -l %SystemRoot%\inf\netnwlnk.inf -c p -i MS_NWIPX")
|