heres the script basically it sets (supposed to) Local area connection ipv4 static ip address to 10.XX.XX.2 but it dosent work it works fine if you run cmd as addy and put the script in netsh interface ip set address "Local Area Connection" static 10.XX.XX.2

Dim txtlen As Integer = Len(TextBox2.Text)
        Dim IPAddy As String = ""
        Dim asciiSplit(4) As Char
        asciiSplit = TextBox2.Text.ToCharArray
        If txtlen = 1 Then IPAddy = "0." & asciiSplit(0).ToString
        If txtlen = 2 Then IPAddy = "0." & asciiSplit(0).ToString & asciiSplit(1).ToString
        If txtlen = 3 Then IPAddy = asciiSplit(0).ToString & "." & asciiSplit(1).ToString & asciiSplit(2).ToString
        If txtlen = 4 Then IPAddy = asciiSplit(0).ToString & asciiSplit(1).ToString & "." & asciiSplit(2).ToString & asciiSplit(3).ToString

        Shell("netsh interface ip set address" & Chr(34) & "Local Area Connection" & Chr(34) & "static 10." & IPAddy & ".4")

        Process.Start("http:\\10." & IPAddy & ".2")
    End Sub

Edited by peter_budo: Keep It Clear - Do wrap your programming code blocks within [code] ... [/code] tags

6 Years
Discussion Span
Last Post by alc6379

try using this msfn.org page to help create the program. Wont use shell scripts, but changes IP within the program using some registry values.

it is in vb6 so some will have to be converted for .net

Edited by mrclark: n/a


I need to figure out how to change static ip address to say 10.xx.xx.2 the xx.xx would be an input but its for communicating with a robot network adapter the computer needs to be at that ip for it to work and doing it manually is to hard for students and rookie teams to do. any help would be greatly appreciated. p.s i tried netsh commands but they have to be exicuted one bye one not together such as

netsh interface ipv4 set address "local area connection" static 10.xx.xx.2
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.