Avoid “Diagnose and Repair” manual step in Win2k8 – get new ip programmatically
At home I have a decently sized server that pretty much covers every role that I need. It is a hyper v server, active domain, file server and if you are a geek like me you know what else it has. What is really annoying is that every time I turn it on it has local connectivity only and I have to “Diagnose and Repair” and then “Get new IP settings for Local Area Connection”.
Well, here is a workaround to fix this issue, simply disable and reenable the connection via command line. I actually created a batch that is executed at startup so that I don’t have to go through the tedious step of doing it myself. (You could solve it once and for all doing a netsh to reinstall TCP, but I didn’t try it):
Open a command line and run the following two commands
To disable:
netsh interface set interface “Local Area Connection” disabled
To enable:
netsh interface set interface “Local Area Connection” enabled
I did not find this on my own, I read it from a post from RobWill in experts-exchange, which is only for subscribers. But here is the link to the guy just to say thanks.
http://www.experts-exchange.com/M_877631.html