Enable - Disable A Network Connection Using WMIC - Microsoft Community
Enable - Disable A Network Connection Using WMIC - Microsoft Community
Community
Products All Microsoft
You can use the following commands to enable or disable your network devices / adapters Windows
/
Windows 10
/
Network and internet
To find the network devices / adapters you want, you must use the following command
( wmic nic get name, index, NetConnectionID )
After finding the network devices / adapters you want to disable, use the following command
( wmic path win32_networkadapter where index = 0 call disable )
Enter your desired index number instead of index = 0 and press the Enter key
You’re invited to try
Use the following command to activate Microsoft 365 for free
( wmic path win32_networkadapter where index = 0 call enable )
Sample code as bat file : Execute the file with the administrator run
*
@echo off
Unlock now
set IndexNumber=10
echo. & echo.==========
echo RESTARTING "%IndexNumber%" adapter. WAIT...
wmic path win32_networkadapter where index="%IndexNumber%" call disable
echo "%IndexNumber%" adapter disabled. Wait...
echo. & echo.==========
timeout /t 3 >nul
timeout /t 1 >nul
EXIT
*
Good luck ,
This thread is locked. You can follow the question or vote as helpful, but you
cannot reply to this thread.
https://answers.microsoft.com/en-us/windows/forum/all/enabledisable-a-network-connection-using-wmic/310992b5-3c74-471e-9c71-eba445a3e7c6 1/2