Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade
Bluetooth technology is widely used for wireless communication between devices. In the Windows environment, pairing Bluetooth devices typically involves using the graphical user interface (GUI). However, there may be scenarios where you need to pair devices via the Command Line (CMD) or PowerShell, such as in automated scripts or remote management situations. This article will guide you through the process of pairing Bluetooth devices using CMD and PowerShell in Windows.
Examples:
Open PowerShell as Administrator:
Win + X
and select Windows PowerShell (Admin)
.Discover Bluetooth Devices:
Get-PnpDevice -Class Bluetooth
InstanceId
of the device you want to pair.Pair the Bluetooth Device:
Add-BluetoothDevice -DeviceInstanceId "YourDeviceInstanceId"
"YourDeviceInstanceId"
with the actual InstanceId
obtained from the previous step.While CMD does not natively support Bluetooth pairing commands, you can use BluetoothCommandLineTools
, a third-party tool, to achieve this. Follow these steps:
Download and Install BluetoothCommandLineTools:
Open CMD as Administrator:
Win + X
and select Command Prompt (Admin)
.Navigate to the Directory:
cd
command to navigate to the directory where you extracted the BluetoothCommandLineTools.
cd C:\path\to\BluetoothCommandLineTools
Discover Bluetooth Devices:
btpair -c
Pair the Bluetooth Device:
btpair -b [MAC Address]
[MAC Address]
with the actual MAC address obtained from the previous step.Pairing Bluetooth devices via CMD or PowerShell in Windows can be useful for automation and remote management. While PowerShell provides some built-in capabilities, using third-party tools like BluetoothCommandLineTools can extend the functionality to CMD.