-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenablebluetooth.cmd
More file actions
44 lines (37 loc) · 1.16 KB
/
Copy pathenablebluetooth.cmd
File metadata and controls
44 lines (37 loc) · 1.16 KB
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
35
36
37
38
39
40
41
42
43
44
@echo off
whoami /user | find /i "S-1-5-18" > nul 2>&1 || (
call RunAsTI.cmd "%~f0" %*
exit /b
)
:: Enable Bluetooth drivers and services
for %%a in (
"BluetoothUserService"
"BTAGService"
"BthA2dp"
"BthAvctpSvc"
"BthEnum"
"BthHFEnum"
"BthLEEnum"
"BthMini"
"BTHMODEM"
"BTHPORT"
"bthserv"
"BTHUSB"
"HidBth"
"Microsoft_Bluetooth_AvrcpTransport"
"RFCOMM"
) do (
call setSvc.cmd %%~a 3
)
:: Seems to not exist sometimes
call setSvc.cmd BthPan 3 > nul 2>&1
:: Enable Bluetooth devices
call toggleDev.cmd -Silent -Enable '*Bluetooth*'
:: https://learn.microsoft.com/en-us/windows/client-management/mdm/policy-csp-connectivity
reg add "HKLM\SOFTWARE\Microsoft\PolicyManager\default\Connectivity\AllowBluetooth" /v "value" /t REG_DWORD /d "2" /f > nul
choice /c:yn /n /m "Would you like to enable the 'Bluetooth File Transfer' Send To context menu entry? [Y/N] "
if %ERRORLEVEL% == 1 attrib -h "%APPDATA%\Microsoft\Windows\SendTo\Bluetooth File Transfer.LNK"
if %ERRORLEVEL% == 2 attrib +h "%APPDATA%\Microsoft\Windows\SendTo\Bluetooth File Transfer.LNK"
echo Finished, please reboot your device for changes to apply.
pause
exit /b