
\bluetooth.ps1 -BluetoothStatus OnĬaveat: If the Bluetooth Support Service is not running, the script attempts to start it because otherwise, WinRT will not see Bluetooth radios. To run it from a batch file: powershell -command. Then you can run it from a PowerShell prompt like this. If you haven't already, follow the instructions in the Enabling Scripts section of the PowerShell tag wiki to enable the execution of scripts on your system. | Out-NullĪwait ($bluetooth.SetStateAsync($BluetoothStatus)) () | Out-Null If ((Get-Service bthserv).Status -eq 'Stopped') This is challenging because of the necessary interoperation with WinRT, but it is possible in pure PowerShell: Param ( I can't believe Microsoft would be so ignorant to not provide such a command… using explorer: ms-settings:bluetooth or explorer.exe %LocalAppData%\Packages\windows.immersivecontrolpanel_cw5n1h2txyewy\LocalState\Indexed\Settings\cs-CZ\AAA_ttingcontent-ms… opens the Bluetooth settings panel, but I still have to click on the toggle.NET: The most relevant page on MSDN doesn't say a word about turning the adapter on/off.
using net as admin: net stop bthserv… doesn't actually turn off the radio (BT speaker continues playing music).
using powershell as admin: Disable-NetAdapter "Bluetooth Network Connection 3" (which is translation of the name of my Bluetooth adapter)… it disables the PAN driver, but a Bluetooth speaker continues playing music….
using devcon as admin: devcon disable USB\VID_8087&PID_07DC&REV_0001 (which is the HW ID of my Bluetooth adapter)… requires reboot to work…. What I've tried (with music playing through a Bluetooth-connected speaker to really know the state of the radio): It does not store any personal data.Such a simple task, one would say, and I haven't found a satisfiable solution. The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not the user has consented to the use of cookies. The cookie is used to store the user consent for the cookies in the category "Performance". This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. The cookies are used to store the user consent for the cookies in the category "Necessary". The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". The cookie is used to store the user consent for the cookies in the category "Analytics". These cookies ensure basic functionalities and security features of the website, anonymously. Required cookies are absolutely essential for the website to function properly.