0% found this document useful (0 votes)
47 views1 page

Enable - Disable A Network Connection Using WMIC - Microsoft Community

This document provides commands to enable and disable network connections using WMIC on Windows. It explains that the WMIC nic command can be used to find network devices and their index numbers. The WMIC path win32_networkadapter call commands can then be used to disable a network connection by specifying its index number, or to enable a previously disabled connection. A sample batch file is also provided to disable and then re-enable a network connection using its index number.

Uploaded by

Silvio Pereira
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views1 page

Enable - Disable A Network Connection Using WMIC - Microsoft Community

This document provides commands to enable and disable network connections using WMIC on Windows. It explains that the WMIC nic command can be used to find network devices and their index numbers. The WMIC path win32_networkadapter call commands can then be used to disable a network connection by specifying its index number, or to enable a previously disabled connection. A sample batch file is also provided to disable and then re-enable a network connection using its index number.

Uploaded by

Silvio Pereira
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

03/11/2022 15:32 Enable/Disable A Network Connection Using WMIC - Microsoft Community

Community
Products All Microsoft

Get Started Ask a new question



Search within Windows 
Buy Microsoft 365  

MD Mojtabajahani Darestani Created on September 15, 2021 Question Info

Enable/Disable A Network Last updated December 15, 2021

Connection Using WMIC Views 692

Hello , Applies to:

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

wmic path win32_networkadapter where index="%IndexNumber%" call enable


echo "%IndexNumber%" adapter Enabled. Wait...
echo. & echo.==========
echo RESTARTING Network Adapter completed successfully

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.

I have the same question (0) Report abuse

https://answers.microsoft.com/en-us/windows/forum/all/enabledisable-a-network-connection-using-wmic/310992b5-3c74-471e-9c71-eba445a3e7c6 1/2

You might also like