Often have to manually shut down a, open another, want to write a program, or written in a Windows command a bat, strives for the command ~
CodePudding user response:
Above is a little wrong, the connection name should be "local connection", "local connection 2" (avoid causing misunderstanding)CodePudding user response:
http://www.uzzf.com/soft/26283.htmlCodePudding user response:
if "% 1"=="l" goto l
If "% 1"=="w" goto w
Echo network address switch batch
Echo setip l - switch to the local connection
Echo setip w - switch to the wireless network connection
Goto e
: l
Echo switch from static IP wireless network to the wired network static IP:
Netsh interface IP set the DHCP address wireless network connection
Netsh interface DHCP IP set the DNS wireless network connection
Netsh interface IP set address local connection static 192.168.1.111 255.255.252.0 192.168.2.1 1
Netsh interface IP set DNS local connection static 202.106.196.115
Goto e
: w
Echo from static IP switch to the wired network infinite network static IP:
Netsh interface IP set address local connection DHCP
Netsh interface IP set DNS local connection DHCP
Netsh interface IP set static address wireless network connection 192.168.1.5 255.255.255.0 192.168.1.1 1
Netsh interface IP set DNS wireless network connection static 211.97.168.129
Goto e
E
CodePudding user response:
http://superuser.com/questions/735292/how-to-open-tcp-ip-properties-from-cmd-or-run-directlyCodePudding user response:
I'm usingOpen_wan. Bat
netsh interface set interface "4 wireless network connection" enabled
Netsh interface set interface "local connection" disabled
Open_lan. Bat
Netsh interface set interface "4 wireless network connection" disabled
Netsh interface set interface "local connection" enabled
CodePudding user response: