Changing my computer ip adress

[b][red]This message was edited by Abou Lamba at 2005-7-1 4:47:39[/red][/b][hr]
[b][red]This message was edited by Abou Lamba at 2005-7-1 4:4:27[/red][/b][hr]
I have to change my computer IP adress frequently, I am trying to build a VB.net application to change it programmaticaly without accessing the network setting (I am using windows server 2003), does anyone have a code that can do this operation?

actually I want to use the netsh command like :
netsh interface ip set address "Local Area Connection" static ipadress subnetmask.

This is the code:

Public Sub ChangeIp(ByVal ipad, ByVal subad)
Dim x
Dim z As String = "netsh interface ip set address "Local Area Connection" static" +ipad +subad
x = Shell(z, vbNormalFocus)
MsgBox("batch file executed")
End Sub

The problem is I cant put a contation (") inside other 2 cotations basicly the " local are connection" inside the netsh operation is the problem anyone can help?


thanks


Comments

  • : [b][red]This message was edited by Abou Lamba at 2005-7-1 4:47:39[/red][/b][hr]
    : [b][red]This message was edited by Abou Lamba at 2005-7-1 4:4:27[/red][/b][hr]
    : I have to change my computer IP adress frequently, I am trying to build a VB.net application to change it programmaticaly without accessing the network setting (I am using windows server 2003), does anyone have a code that can do this operation?
    :
    : actually I want to use the netsh command like :
    : netsh interface ip set address "Local Area Connection" static ipadress subnetmask.
    :
    : This is the code:
    :
    : Public Sub ChangeIp(ByVal ipad, ByVal subad)
    : Dim x
    : Dim z As String = "netsh interface ip set address "Local Area Connection" static" +ipad +subad
    : x = Shell(z, vbNormalFocus)
    : MsgBox("batch file executed")
    : End Sub
    :
    : The problem is I cant put a contation (") inside other 2 cotations basicly the " local are connection" inside the netsh operation is the problem anyone can help?
    :
    :
    : thanks
    :
    :
    :

    if I undestood your problem then you' ll have to to use 3 of them before and after.

    e.g:

    Dim NumberOfDays As String = "Seven"
    ..
    ..
    MsgBox("""The number of days are: """ & NumberOfDays)









  • [b][red]This message was edited by Abou Lamba at 2005-7-1 16:37:23[/red][/b][hr]
    : : [b][red]This message was edited by Abou Lamba at 2005-7-1 4:47:39[/red][/b][hr]
    : : [b][red]This message was edited by Abou Lamba at 2005-7-1 4:4:27[/red][/b][hr]
    : : I have to change my computer IP adress frequently, I am trying to build a VB.net application to change it programmaticaly without accessing the network setting (I am using windows server 2003), does anyone have a code that can do this operation?
    : :
    : : actually I want to use the netsh command like :
    : : netsh interface ip set address "Local Area Connection" static ipadress subnetmask.
    : :
    : : This is the code:
    : :
    : : Public Sub ChangeIp(ByVal ipad, ByVal subad)
    : : Dim x
    : : Dim z As String = "netsh interface ip set address "Local Area Connection" static" +ipad +subad
    : : x = Shell(z, vbNormalFocus)
    : : MsgBox("batch file executed")
    : : End Sub
    : :
    : : The problem is I cant put a contation (") inside other 2 cotations basicly the " local are connection" inside the netsh operation is the problem anyone can help?
    : :
    : :
    : : thanks
    : :
    : :
    : :
    :
    : if I undestood your problem then you' ll have to to use 3 of them before and after.
    :
    : e.g:
    :
    : Dim NumberOfDays As String = "Seven"
    : ..
    : ..
    : MsgBox("""The number of days are: """ & NumberOfDays)
    :
    :
    :
    :
    hmm i wil see


  • Dear Sir,
    We are also struggling same problem to change the network setting from Vb. Net code. If you know the solution please sends the code & your valuable comments to implement in our system. We are developing once system where we need to make changes by the network setting by the user from our code by putting the IP from remote location since that machine dose not have the monitor.


    Please reply me to [email protected]

    Waiting for your valuable reply

    Bye
    Ayush
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories