Func _CMD_SetLocalIP($ConName, $IpADD, $SubMask, $GateWay, $ConDNS)
If $SubMask = "" Then $SubMask = "255.255.255.0"
If $ConName = "" And $IpADD <> "" Then
RunWait(@ComSpec & ' /C netsh -c interface ip set address "本地连接" static ' & $IpADD & " " & $SubMask & " " & $GateWay, "", @SW_HIDE)
EndIf
If $ConName <> "" And $IpADD <> "" Then
RunWait(@ComSpec & ' /C netsh -c interface ip set address ' & '"' & $ConName & '"' & ' static ' & $IpADD & " " & $SubMask & " " & $GateWay, "", @SW_HIDE)
EndIf
If $ConDNS <> "" Then
RunWait(@ComSpec & ' /C netsh -c interface ip set dns ' & '"' & $ConName & '"' & ' static ' & $ConDNS & ' primary', "", @SW_HIDE)
EndIf
EndFunc ;==>_CMD_SetLocalIP
你参考上面这段源码,用cmd试试看错在哪呗 |