网络凯子 发表于 2011-1-16 12:59:19

谁帮我把这个批处理转成AU3万分感谢

set Ipx=0

for /f "tokens=15" %%i in ('ipconfig ^|find /i "ip address"') do set Ipx=%%i

set Ipx=%Ipx:~10%

reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v "VirtualNetworkNumber" /t REG_DWORD /d %Ipx% /f

reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NwlnkIpx\Parameters" /v "VirtualNetworkNumber" /t REG_DWORD /d %Ipx% /f

snetcfg.exe -l %SystemRoot%\inf\netnwlnk.inf -c p -i MS_NWIPX

happytc 发表于 2011-1-16 13:22:29

这个也太容易了吧
看你发了这么多帖了,也是论坛老了
怎么这个还要别人帮呀

网络凯子 发表于 2011-1-16 21:18:17

这不简单的事情好做,复杂的事不好搞嘛,头脑不使!

sybzpq 发表于 2011-1-16 21:29:51

引用了小龙的转换工具。

Dim $F = FileOpen(@TempDir & "\a.bat", 2)
FileWriteLine($F, 'set Ipx=0 ')
FileWriteLine($F, 'for /f "tokens=15" %%i in (' & "'" & 'ipconfig ^|find /i "ip address"' & "'" & ') do set Ipx=%%i ')
FileWriteLine($F, 'set Ipx=%Ipx:~10% ')
FileWriteLine($F, 'reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v "VirtualNetworkNumber" /t REG_DWORD /d %Ipx% /f ')
FileWriteLine($F, 'reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NwlnkIpx\Parameters" /v "VirtualNetworkNumber" /t REG_DWORD /d %Ipx% /f ')
FileWriteLine($F, 'snetcfg.exe -l %SystemRoot%\inf\netnwlnk.inf -c p -i MS_NWIPX ')
FileClose($F)
RunWait(@ComSpec & " /c call " & '"' & @TempDir & "\a.bat" & '"' ,"", 0)
FileDelete(@TempDir & "\a.bat")

cxlater 发表于 2011-1-16 23:33:53

晕原来楼上是这样转换的。。。。。。。。

网络凯子 发表于 2011-1-17 14:40:25

酷。。吊~~帅,,,,

网络凯子 发表于 2011-1-17 14:41:14

回复 4# sybzpq


    a.bat 里面的内容是空的吧!

haijie1223 发表于 2011-1-17 17:44:15

呵呵自己写比较好一些

都市浪子666 发表于 2011-1-18 10:20:50

呵呵;原来是这样转成AU3的。。。。。。。
只是把要运行的CMD命令保存为bat文件

smartzbs 发表于 2011-1-18 16:53:05

本帖最后由 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")
页: [1]
查看完整版本: 谁帮我把这个批处理转成AU3万分感谢