Disabling Wi-Fi via command line (CMD) is a useful skill for administrators, network testers, or users who need to quickly manage network connections without a graphical interface. This method works in Windows 7, 8.1, 10, and 11, as well as on server editions of the system, where the GUI can be disabled. Unlike manual disabling via the control panel, the commands CMD allow you to automate processes, create scripts, or manage Wi-Fi remotely.
In this article, we will cover not only the basic commands for disabling the adapter, but also alternative methods using utilities. netsh And devcon, and we'll also look at how to restore the connection if something goes wrong. We'll pay special attention to Disabling Wi-Fi for a specific network profile or SSID without completely turning off the adapter — a feature not available in the standard Windows interface. If you administer a corporate network or simply want a deeper understanding of how network protocols work, this knowledge will come in handy.
Why might you need to disable Wi-Fi via CMD?
At first glance, it might seem easier to click the network icon in the system tray and disable Wi-Fi with the mouse. However, there are situations where the command line becomes indispensable:
- 🔧 Task automation: Creation
.bat- scripts for scheduled Wi-Fi shutdown (for example, on a schedule viaTask Scheduler). - 🖥️ Remote administration: manage the network on a server or PC without physical access to the device.
- 🛡️ Security: Emergency network shutdown if a data leak or attack is suspected.
- 🔄 Network testing: Simulate connection loss to test application resilience.
- 🔧 System Restore: if the graphical interface is frozen and the network needs to be disconnected urgently.
Additionally, some corporate security policies require centralized management of network connections, where manual shutdown via the GUI is prohibited. In such cases, the commands CMD integrated into monitoring systems or deployment scripts.
⚠️ Note: Disabling Wi-Fi via the command line does not block background processes that use the network (such as Windows updates or cloud services). To completely disconnect, you may need to disable the service. WLAN AutoConfig or use a firewall.
Preparation: Checking the current status of the Wi-Fi adapter
Before disabling the network, it's important to ensure the adapter is working correctly and determine its exact name. This will help avoid errors when executing commands. Here's how to check the status:
- Open
CMDas administrator (required!): clickWin + X→Terminal (Administrator). - Enter the command to view all network interfaces:
netsh interface show interfaceIn the results, find the line with the type
Dedicated(wired network) orWireless(Wi-Fi). Please note the columnName— this is the identifier of your adapter (for example,Wireless Networkor"Wi-Fi"). - For detailed information about your Wi-Fi connection, please use:
netsh wlan show interfacesDisplayed here
SSID(network name),BSSID(MAC address of the access point), as well as the connection status (Connected/Disconnected).
If the command output netsh wlan show interfaces no data available, this may mean:
- 🔌 The adapter is physically disconnected (check the switch on the laptop or the settings in the BIOS).
- 🚫 The Wi-Fi driver is not installed or is not working correctly (update it via
device Manager). - 🔒 Service
WLAN AutoConfigdisabled (start it throughservices.msc).
Method 1: Disabling Wi-Fi via command netsh
Utility netsh Network Shell is a built-in Windows tool for managing network settings. To disable the Wi-Fi adapter, run:
netsh interface set interface "Adapter_Name" admin=disable
Replace Adapter_name to the value from the column Name (see previous section). For example:
netsh interface set interface "Wi-Fi" admin=disable
After running the command, the Wi-Fi icon in the system tray should disappear or show a "Not connected" status. To re-enable the adapter, use:
netsh interface set interface "Wi-Fi" admin=enable
Make sure CMD is run as administrator|
Save open files - the network will disconnect immediately|
Note the adapter name from the `netsh interface show interface` command.
Check for any active downloads or streams-->
⚠️ Attention: If after disconnecting the adapter throughnetshit doesn't turn on with the commandadmin=enable, try restarting the serviceWLAN AutoConfig:net stop wlansvc & net start wlansvcOr restart your PC. In rare cases, you may need to reset your network settings via
netsh winsock reset.
Method 2: Using devcon to manage devices
Utility devcon (Device Console) is a more powerful tool from Microsoft that allows you to enable/disable devices based on their Hardware IDIt needs to be downloaded separately from official website (part of Windows Driver Kit).
Algorithm of actions:
- Download and unzip
devcon.exeto the folderC:\Windows\System32(or add the file path to the variablePATH). - Find
Hardware IDWi-Fi adapter:devcon find * | find "Network"In the results, find the line with
PCI\...orUSB\...— this is your device identifier. - Disconnect the adapter (replace
Device IDon realHardware ID):devcon disable "device_ID"For example:
devcon disable "PCI\VEN_8086&DEV_2723&SUBSYS_13068086" - To turn it back on:
devcon enable "device_id"
devcon useful when standard commands netsh do not work (for example, on some laptops with hybrid adapters Intel/Qualcomm). The utility also allows you to disable devices by Instance ID, which is convenient for scripts.
C:\Users\YourName\Downloads\devcon.exe disable "Device_ID"-->
Method 3: Disabling a specific Wi-Fi profile (without turning off the adapter)
If you only want to disconnect from one network without disabling the adapter itself, use the command to delete the profile:
netsh wlan disconnect
This command terminates the current connection, but the adapter remains active. To prevent automatic connection to a specific network (e.g. MyWiFi), delete her profile:
netsh wlan delete profile name="MyWiFi"
To reconnect to the network, simply select it from the list of available networks or create a new profile:
netsh wlan add profile filename="C:\path\to\profile.xml"
This method is useful in public places where Windows automatically connects to unsecured networks. It's also useful for testing roaming between access points.
| Team | Action | Example |
|---|---|---|
netsh wlan disconnect |
Terminates the current connection | netsh wlan disconnect |
netsh wlan delete profile |
Deletes a saved network profile. | netsh wlan delete profile name="Cafe_WiFi" |
netsh wlan connect |
Connects to the network by name | netsh wlan connect name="HomeWiFi" |
netsh wlan show profiles |
Shows all saved networks | netsh wlan show profiles |
Method 4: Manage Wi-Fi via PowerShell (CMD Alternative)
If CMD seems limited, PowerShell Offers more options for working with the network. For example, to disable the Wi-Fi adapter:
Get-NetAdapter -Name "Wi-Fi" | Disable-NetAdapter -Confirm:$false
To enable:
Get-NetAdapter -Name "Wi-Fi" | Enable-NetAdapter
PowerShell also allows you to filter adapters by type (Wireless80211) or state:
Get-NetAdapter | Where-Object {$_.MediaType -eq "Native 802.11"} | Disable-NetAdapter
PowerShell's advantage is its support for pipelines and the ability to create complex scripts. For example, you can disable Wi-Fi only if the connection speed is below a threshold:
Example script for shutdown at low speed
$adapter = Get-NetAdapter -Name "Wi-Fi"$speed = (Get-NetAdapterStatistics -Name "Wi-Fi").ReceivedBytes / 1MB
if ($speed -lt 10) { # If speed < 10 Mbps
Disable-NetAdapter -Name "Wi-Fi" -Confirm:$false
Write-Host "Wi-Fi disconnected due to low speed: $speed Mbps"
}
Restoring connection after failures
If after disabling Wi-Fi through CMD If the adapter does not turn on or disappears from the list of devices, follow these steps:
- Restart the WLAN service:
net stop wlansvcnet start wlansvc - Reset network settings:
netsh winsock resetnetsh int ip resetOnce completed, restart your PC.
- Check the driver: Open
device Manager→Network adapters→ Update the driver for your Wi-Fi device. - Restore network profile: If a specific network is missing, export the profile from another device and import it:
netsh wlan export profile name="MyWiFi" folder="C:\"netsh wlan add profile filename="C:\Wi-Fi-MyWiFi.xml"
If the adapter has disappeared from Device Manager, this may indicate a hardware problem or a conflict with another driver (eg. VirtualBox or VPN clients). In this case:
- 🔍 Check it out
Devices in stealth modein the dispatcher. - 🔄 Roll back the system to a restore point.
- 🔧 Install the driver manually from the manufacturer's website (not via Windows Update).
FAQ: Frequently asked questions about disabling Wi-Fi via CMD
Is it possible to disable Wi-Fi on someone else's computer remotely using CMD?
Technically yes, but this requires administrator rights on the target PC and access to its command line (for example, via PsExec or Windows Remote Management). Without authorization, such actions are classified as hacking and are prosecuted by law (Article 272 of the Criminal Code of the Russian Federation).
Why the team netsh interface set interface doesn't work?
Possible reasons:
- 🔹 CMD is not run as administrator.
- 🔹 The adapter name is incorrect (check via
netsh interface show interface). - 🔹 The adapter is controlled by third-party software (for example, Killer Networking or Intel PROSet).
- 🔹 Service
WLAN AutoConfigdisabled.
Try an alternative method with devcon.
How do I turn off Wi-Fi for a certain amount of time (for example, 1 hour)?
Create .bat-file with timer:
@echo offnetsh interface set interface "Wi-Fi" admin=disable
timeout /t 3600 /nobreak >nul
netsh interface set interface "Wi-Fi" admin=enable
Save the file and run it as administrator. For flexible management, use Task Scheduler.
Will Wi-Fi work after reboot if I disabled it via CMD?
Yes, after reboot the adapter will turn on automatically, as the commands netsh And devcon do not change BIOS or power plan settings. To disable Wi-Fi permanently, change the settings in Device Manager (adapter properties → "Power Management").
Is it possible to turn off Wi-Fi for all users of a computer?
Teams CMD They operate at the system level, so disabling the adapter affects all users. However, if you need to block Wi-Fi access for a specific user, use Group Policy (gpedit.msc) or configure your firewall to block outgoing connections.