I need to enable/disable network connections on windows with a batch file.
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.
-
I had to change "Local Area Connection " to "Local Area Connection", but this works great – Das.Rot Jan 21 '14 at 17:07
netsh wlan connect ssid=*SSID HERE*name= network name HERE interface="Wireless Network Connection"
and
disconnect interface="Wireless Network Connection"
both actually work in windows 7