I am trying to run a script that disconnects and reconnects to the internet. In cmd.exe I am using the lines

netsh interface set interface "Local Area Connection" disabled
netsh interface set interface "Local Area Connection" enabled

The disabled works as expected, and the enable line does re-enable the Local Area Connection but it doesn't reconnect to the internet, and I only get internet back if I restart my computer.

Further investigation showed that if I disabled the Local Area Connection and then enabled it manually via the device manager it failed to start, with error message: This device cannot start (Code 10).

Any ideas on what this problem is caused by, or another way to disconnect and reconnect to the internet using cmd.exe? Thanks.

(And I am using windows 7).

link|improve this question
What LAN card or controller do you have? Is this a USB device? (If USB, it can't be done. Once stopped, it's no longer connected and there's no way to send it a command to start again.) – David Schwartz Jan 31 at 10:57
feedback

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown

Browse other questions tagged or ask your own question.