Wednesday 29 November 2017

windows - My usb 3g data card sometimes switches to 2g but never switches back without plugging it in and out again


Is there a way to automate the redial process once that happens?


Screenshot



Answer



[PowerShell] disable+enable all connections


The most elegant method to reset all connections is maybe PowerShell. Save this as .PS1 script and execute it with admin rights.


Get-WMIObject Win32_NetworkAdapter -Filter "NetConnectionID LIKE '%'" | %{
netsh interface set interface "$($_.NetConnectionID)" DISABLED
Start-Sleep 3
netsh interface set interface "$($_.NetConnectionID)" ENABLED
}

Source




[CMD] disable+enable connection


Save this in a batch and execute it as admin where stands for the interface you want to disable and re-enable.


netsh interface set interface  disabled  
ping -n 5 127.0.0.1 > NUL
netsh interface set interface enabled


  • To get the correct interface name, type netsh interface show interface

  • Wrap the interface name with quotation marks when it contain blanks (otherwise not)

  • the ping command just adds a small break of 5 sec to see the effect in Network and Sharing center




[CMD] reconnect mobile connection


(thx @laggingreflex)


netsh mbn connect interface= connmode=name name=

enter image description here


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...