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).