Link to home
Start Free TrialLog in
Avatar of jack niekerk
jack niekerkFlag for Netherlands

asked on

in VB6 changing IP adres Windows XP

I have a not managed by a person pc running some programs and send reports by mail to me
it will happen that some one connects on the network with a static (laptop eg) IP adres
my PC is willgo sometimes in connection error due to IP conflict caused with by this other device
My email routine will report to my VB6 program it lost connection
Now I only need a sub routine to renew my own IP adres to reconnect
Avatar of David Lee
David Lee
Flag of United States of America image

The simplest solution will be to use a shell object to run the commands

ipconfig /release all
ipconfig /renew

Something like this

Sub RenewIP()
    Dim objShell As Object
    Set objShell = CreateObject("Wscript.Shell")
    objShell.Run "ipconfig /release all", , True
    objShell.Run "ipconfig /renew", , True
    Set objShell = Nothing
End Sub

Open in new window

Avatar of jack niekerk

ASKER

Ok, did set as test a pc to my IP adres, I will get the know error "conflict with other pc"
then  the command (tested from commandline )   will state at
ipconfig /release all   (enter)  (translated from dutch Windows)

"the command did not work since not a single network adapter is at a state do perform this command"  

My pc is not static on IP , so get a new one right?
ASKER CERTIFIED SOLUTION
Avatar of aikimark
aikimark
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
THANKS