Sample batch scripts using Bluetooth Command Line Tools

 

 

1. Connect (reconnect) and enable bluetooth mouse, headset, gps receiver or other device

This script removes the remote bluetooth device from your system (if present), than adds and configures it again.

This script requires Bluetooth Command Line Tools 1.2.0.56 or higher.
It may be necessary to switch the remote bluetooth device into 'discoverable' mode before running the script. (Consult the documentation of your bluetooth device).

Usage:
1. Copy the following script into your text editor (e.g. notepad).
2. Change device address and service GUID to match your device. (To obtain these values, run 'btdiscovery -s'). Optionally set the PIN code.
3. Save the file with '.bat' extension.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
@echo off

rem   The following line is needed only if you haven't added Bluetooth Command Line Tools to system PATH
set PATH=c:\program files\bluetooth command line tools\bin;%PATH%

rem   Change the following 2 lines to match your device
set DEVICE_ADDRESS=00:01:02:03:FF:FF
set SERVICE_UUID=1124

rem   If your device requires PIN code other than '0000', uncomment and change the following line
rem set PIN=1234


rem   Remove the device. Ignoring possible error here 
btpair -u -b"%DEVICE_ADDRESS%"

rem   Pair the device
btpair -p%PIN% -b"%DEVICE_ADDRESS%"
if errorlevel 1 goto error

rem   Enable the service
btcom -c -b"%DEVICE_ADDRESS%" -s%SERVICE_UUID%
if errorlevel 1 goto error

goto success

rem   Allow user to read error message before window is closed
:error
pause
exit

:success
exit

Download and install

Download setup package from the Bluetooth command line tools home page

Feedback and contacts

Please report bugs, request features and send other feedback to bct@bluetoothinstaller.com

Subscribe to Bluetooth Command Line Tools RSS feed

 


Bluetooth command line tools | Directory of Bluetooth Resources | Bluetooth Driver Installer | Bluetooth Stack Switcher

Privacy policy | Terms and conditions
Copyright © 2009-2015 BluetoothInstaller.com