A simple, lightweight command-line utility to quickly turn Bluetooth on or off in Windows 10 and Windows 11.
Windows does not provide a native, built-in command-line tool to directly control the Bluetooth radio state. While it's possible to disable the hardware adapter through Device Manager or with complex PowerShell scripts, there isn't a simple way to replicate the "On/Off" toggle found in the Action Center or Settings panel.
This tool was created to fill that gap. It provides a straightforward, single-purpose executable that allows users and scripts to easily manage the Bluetooth radio state without navigating any UI.
- Turn Bluetooth ON with a simple command.
- Turn Bluetooth OFF with a simple command.
- Acts as a software switch, not a hardware driver disabler.
- Perfect for automation scripts, custom hotkeys, or quick access.
- Single, portable executable file with no installation required.
- Download the latest
BluetoothSwitcher.exefrom the Releases page. - Place the executable in a convenient location (e.g., a folder included in your system's PATH).
- Open a command prompt (CMD), PowerShell, or Windows Terminal and run the following commands:
# To turn Bluetooth ON
.\BluetoothSwitcher.exe on
# To turn Bluetooth OFF
.\BluetoothSwitcher.exe offNote: The first time you run the application, Windows may prompt you for permission to allow the app to control the device's radios. You must allow this for the tool to function correctly.
This tool is a .NET 8 C# console application that utilizes the Windows Runtime (WinRT) API. It specifically uses the Windows.Devices.Radios namespace to find the system's Bluetooth radio and programmatically change its state via SetStateAsync(). This is the modern, recommended method for controlling radio states on Windows.
If you prefer to build the executable yourself, you can publish it as a single, self-contained file directly from Visual Studio.
- Visual Studio 2022
- .NET 8 SDK (or the version specified in the
.csprojfile) - Windows 10 SDK (version 10.0.19041.0 or newer), included with the ".NET desktop development" workload in the Visual Studio Installer.
-
Clone the repository:
git clone https://github.com/rafarrw/Bluetooth-Command-Line-Switcher-for-Windows.git cd Bluetooth-Command-Line-Switcher-for-Windows -
Open the solution file (
.sln) in Visual Studio. -
Publish the project:
- In the Solution Explorer, right-click on the
BluetoothSwitcherproject and select Publish. - Choose Folder as the publishing target and click Next.
- Choose a specific location (or leave the default) and click Finish. This will create a publish profile.
- In the Solution Explorer, right-click on the
-
Configure the publish profile:
- After the profile is created, you will see a summary. Click the "Show all settings" link.
- Set the following options:
- Deployment mode:
Self-contained(This includes the .NET runtime so it can run anywhere). - Target runtime:
win-x64 - Check the box for "Produce single file".
- Deployment mode:
- Click Save.
-
Publish:
- Click the Publish button in the top right.
-
Locate the executable:
- Visual Studio will compile the project and place the final, single
BluetoothSwitcher.exefile in the publish folder (e.g.,bin\Release\net8.0-windows10.0.19041.0\win-x64\publish\). You can take this single file and run it on any modern 64-bit Windows machine.
- Visual Studio will compile the project and place the final, single
This project is licensed under the MIT License. See the LICENSE file for more details.