Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disabling DHCP From Visual Basic

Status
Not open for further replies.

LegoPiece

Programmer
Mar 19, 2001
95
US
Hi Guys!

I guess the question says it all really. What I need to do is to first determine if the local machine has DHCP enabled, and if so - how to disable it and provide the local computer with an IP Host name, IP Address, Subnet Mask and Default Gateway from VB.

Is this even possible?
Peace Thanks!
LeGo PiEcE

"The Computer Spock! Destroy it!" - Captain James T. Kirk
 
Anybody? Thanks!
LeGo PiEcE

"The Computer Spock! Destroy it!" - Captain James T. Kirk
 
Hmm. Interesting question. I suspect that it can be done, but have not actually tried to figure out how to do it.

Some thoughts: all the network configuration stuff is held in the registry. So, assuming that you have all the necessary services/drivers actually running yoo can probably get away with this by simple rewriting of the registry and a reboot. Enabling or disabling DHCOP shouldn't actually require any rebinding no matter what the dialog boxes suggest when you do this through Control Panel.

Please note that this is (informed) supposition, rather than a definitive statement.
 
I've been looking into it myself, and you're right: it does require the modification of a couple of registry keys, however it's been a tough one scouring the web for that information. I guess it's not too much of a big deal though, I can just get the user to manually disable DHCP through the control panel -> network properties, but it puts a little damper on things as the rest of my software's functionality kicks royal butt!

Fortunately though, I was able to get my VB application to detect if DHCP was enabled or not through a little cheating, and if indeed DHCP is disabled on the local machine, then my software goes to work on it. So, a bird in the hand is worth two in the bush!

Cheers Anyway! =) Thanks!
LeGo PiEcE

"The Computer Spock! Destroy it!" - Captain James T. Kirk
 
HEY LEGO,,

I WAS WONDERING IF YOU CAN HELP ME OUT AS TO HOW YOU GO ABOUT DOING THIS...


ENGI
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top