I need to enable/disable network connections on windows with a batch file.
3 Answers
You can do this with Windows PowerShell. Here's a page with examples.
Probably you want to use the last one on that page.
Update
A little more searching reminded me about netsh, which is a more appropriate tool than either PowerShell or devcon:
netsh interface set interface "Local Area Connection " ENABLE
netsh interface set interface "Local Area Connection " DISABLE
I'm not sure which version of Windows you're using, but here's the netsh doc for XP to get you started.
1 Comment
Das.Rot
I had to change "Local Area Connection " to "Local Area Connection", but this works great