In some scenarios, we connect several network cards to our PC. For each network card, Windows creates a new local area connection, which is identified as: "Local Area Connection X", Where "X" is the number assigned by windows to this new connection. Windows incrementally assigns this number to new network cards. Regardless of whether the network cards previously connected, exist or not. This can be verified with the following commands:
wmic nic get name, index wmic nic where "netconnectionid like '%'" get netconnectionid FOR /F "tokens=*" %i IN ('NetSh.exe Interface IP Show Interface') DO echo %i wmic nic where "NetConnectionStatus=2" get NetConnectionID |more +1
Possible regedit path:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Network HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Network\
How can I clean all previous network connections, and "Local Area Connection X" that no longer exist, and reset network cards by default.
I prefer to do it with batch (devcon, wmic, etc. Not gui)
PD: About "netsh interface set interface "Local Area Connection" DISABLED" This answer is not enough