How to toggle Win10 bluetooth off and on at startup












0














I have a Win10 laptop that I move back and forth between home and work. I use identical-but-separate bluetooth mice at each location. Each time I switch locations (and thus switch bluetooth mice), I must go into Settings to toggle of, and back on again, the bluetooth "switch" to make the laptop connect to the new mouse (even though it shows up as already "paired" in the list of bluetooth devices). Note this is the case even across reboots.



Of course my first thought to automate this process was to just use a script to bounce the bluetooth service(s) at boot time to emulate the turning off and back on again the bluetooth switch in the Settings page. But it seems I'm failing to identify the right service (if in fact that is the right approach) to toggle. I've used powershell to stop "bthserv" and "ibtsiva", but my mouse is still happily working fine, so obviously that is not equivalent to turning "off" the bluetooth switch.



PS C:WINDOWSsystem32> get-service -DisplayName *Bluetooth*

Status Name DisplayName
------ ---- -----------
Stopped BluetoothUserSe... Bluetooth User Support Service_3b07...
Stopped BTAGService Bluetooth Audio Gateway Service
Stopped bthserv Bluetooth Support Service
Stopped ibtsiva Intel Bluetooth Service


Is there some other service I should be toggling? Or is the service just completely the wrong approach? Forcing the hardware to shut down and start again works every time, so it definitely includes whatever action I need to do. I just need to find a way to automate it. Any pointers?










share|improve this question






















  • You could try Get-Service -DisplayName *Bluetooth* | Restart-Service. You might also try the Radio Management Service.
    – harrymc
    Dec 6 at 16:32


















0














I have a Win10 laptop that I move back and forth between home and work. I use identical-but-separate bluetooth mice at each location. Each time I switch locations (and thus switch bluetooth mice), I must go into Settings to toggle of, and back on again, the bluetooth "switch" to make the laptop connect to the new mouse (even though it shows up as already "paired" in the list of bluetooth devices). Note this is the case even across reboots.



Of course my first thought to automate this process was to just use a script to bounce the bluetooth service(s) at boot time to emulate the turning off and back on again the bluetooth switch in the Settings page. But it seems I'm failing to identify the right service (if in fact that is the right approach) to toggle. I've used powershell to stop "bthserv" and "ibtsiva", but my mouse is still happily working fine, so obviously that is not equivalent to turning "off" the bluetooth switch.



PS C:WINDOWSsystem32> get-service -DisplayName *Bluetooth*

Status Name DisplayName
------ ---- -----------
Stopped BluetoothUserSe... Bluetooth User Support Service_3b07...
Stopped BTAGService Bluetooth Audio Gateway Service
Stopped bthserv Bluetooth Support Service
Stopped ibtsiva Intel Bluetooth Service


Is there some other service I should be toggling? Or is the service just completely the wrong approach? Forcing the hardware to shut down and start again works every time, so it definitely includes whatever action I need to do. I just need to find a way to automate it. Any pointers?










share|improve this question






















  • You could try Get-Service -DisplayName *Bluetooth* | Restart-Service. You might also try the Radio Management Service.
    – harrymc
    Dec 6 at 16:32
















0












0








0







I have a Win10 laptop that I move back and forth between home and work. I use identical-but-separate bluetooth mice at each location. Each time I switch locations (and thus switch bluetooth mice), I must go into Settings to toggle of, and back on again, the bluetooth "switch" to make the laptop connect to the new mouse (even though it shows up as already "paired" in the list of bluetooth devices). Note this is the case even across reboots.



Of course my first thought to automate this process was to just use a script to bounce the bluetooth service(s) at boot time to emulate the turning off and back on again the bluetooth switch in the Settings page. But it seems I'm failing to identify the right service (if in fact that is the right approach) to toggle. I've used powershell to stop "bthserv" and "ibtsiva", but my mouse is still happily working fine, so obviously that is not equivalent to turning "off" the bluetooth switch.



PS C:WINDOWSsystem32> get-service -DisplayName *Bluetooth*

Status Name DisplayName
------ ---- -----------
Stopped BluetoothUserSe... Bluetooth User Support Service_3b07...
Stopped BTAGService Bluetooth Audio Gateway Service
Stopped bthserv Bluetooth Support Service
Stopped ibtsiva Intel Bluetooth Service


Is there some other service I should be toggling? Or is the service just completely the wrong approach? Forcing the hardware to shut down and start again works every time, so it definitely includes whatever action I need to do. I just need to find a way to automate it. Any pointers?










share|improve this question













I have a Win10 laptop that I move back and forth between home and work. I use identical-but-separate bluetooth mice at each location. Each time I switch locations (and thus switch bluetooth mice), I must go into Settings to toggle of, and back on again, the bluetooth "switch" to make the laptop connect to the new mouse (even though it shows up as already "paired" in the list of bluetooth devices). Note this is the case even across reboots.



Of course my first thought to automate this process was to just use a script to bounce the bluetooth service(s) at boot time to emulate the turning off and back on again the bluetooth switch in the Settings page. But it seems I'm failing to identify the right service (if in fact that is the right approach) to toggle. I've used powershell to stop "bthserv" and "ibtsiva", but my mouse is still happily working fine, so obviously that is not equivalent to turning "off" the bluetooth switch.



PS C:WINDOWSsystem32> get-service -DisplayName *Bluetooth*

Status Name DisplayName
------ ---- -----------
Stopped BluetoothUserSe... Bluetooth User Support Service_3b07...
Stopped BTAGService Bluetooth Audio Gateway Service
Stopped bthserv Bluetooth Support Service
Stopped ibtsiva Intel Bluetooth Service


Is there some other service I should be toggling? Or is the service just completely the wrong approach? Forcing the hardware to shut down and start again works every time, so it definitely includes whatever action I need to do. I just need to find a way to automate it. Any pointers?







powershell bluetooth






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 6 at 14:01









Jimbo1987

31




31












  • You could try Get-Service -DisplayName *Bluetooth* | Restart-Service. You might also try the Radio Management Service.
    – harrymc
    Dec 6 at 16:32




















  • You could try Get-Service -DisplayName *Bluetooth* | Restart-Service. You might also try the Radio Management Service.
    – harrymc
    Dec 6 at 16:32


















You could try Get-Service -DisplayName *Bluetooth* | Restart-Service. You might also try the Radio Management Service.
– harrymc
Dec 6 at 16:32






You could try Get-Service -DisplayName *Bluetooth* | Restart-Service. You might also try the Radio Management Service.
– harrymc
Dec 6 at 16:32












1 Answer
1






active

oldest

votes


















0














See this Q&A …



Turn on/off Bluetooth radio/adapter from cmd/powershell in Windows 10



[CmdletBinding()] 
Param
(
[Parameter(Mandatory=$true)][ValidateSet('Off', 'On')][string]$BluetoothStatus
)

If ((Get-Service bthserv).Status -eq 'Stopped')
{ Start-Service bthserv }

Add-Type -AssemblyName System.Runtime.WindowsRuntime
$asTaskGeneric = ([System.WindowsRuntimeSystemExtensions].GetMethods() `
| ? { $_.Name -eq 'AsTask' -and $_.GetParameters().Count -eq 1 -and $_.GetParameters()[0].ParameterType.Name -eq 'IAsyncOperation`1' })[0]

Function Await($WinRtTask, $ResultType)
{
$asTask = $asTaskGeneric.MakeGenericMethod($ResultType)
$netTask = $asTask.Invoke($null, @($WinRtTask))
$netTask.Wait(-1) | Out-Null
$netTask.Result
}

[Windows.Devices.Radios.Radio,Windows.System.Devices,ContentType=WindowsRuntime] | Out-Null

[Windows.Devices.Radios.RadioAccessStatus,Windows.System.Devices,ContentType=WindowsRuntime] | Out-Null
Await ([Windows.Devices.Radios.Radio]::RequestAccessAsync()) ([Windows.Devices.Radios.RadioAccessStatus]) | Out-Null

$radios = Await ([Windows.Devices.Radios.Radio]::GetRadiosAsync()) ([System.Collections.Generic.IReadOnlyList[Windows.Devices.Radios.Radio]])
$bluetooth = $radios | ? { $_.Kind -eq 'Bluetooth' }

[Windows.Devices.Radios.RadioState,Windows.System.Devices,ContentType=WindowsRuntime] | Out-Null
Await ($bluetooth.SetStateAsync($BluetoothStatus)) ([Windows.Devices.Radios.RadioAccessStatus]) | Out-Null





share|improve this answer





















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1381354%2fhow-to-toggle-win10-bluetooth-off-and-on-at-startup%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    See this Q&A …



    Turn on/off Bluetooth radio/adapter from cmd/powershell in Windows 10



    [CmdletBinding()] 
    Param
    (
    [Parameter(Mandatory=$true)][ValidateSet('Off', 'On')][string]$BluetoothStatus
    )

    If ((Get-Service bthserv).Status -eq 'Stopped')
    { Start-Service bthserv }

    Add-Type -AssemblyName System.Runtime.WindowsRuntime
    $asTaskGeneric = ([System.WindowsRuntimeSystemExtensions].GetMethods() `
    | ? { $_.Name -eq 'AsTask' -and $_.GetParameters().Count -eq 1 -and $_.GetParameters()[0].ParameterType.Name -eq 'IAsyncOperation`1' })[0]

    Function Await($WinRtTask, $ResultType)
    {
    $asTask = $asTaskGeneric.MakeGenericMethod($ResultType)
    $netTask = $asTask.Invoke($null, @($WinRtTask))
    $netTask.Wait(-1) | Out-Null
    $netTask.Result
    }

    [Windows.Devices.Radios.Radio,Windows.System.Devices,ContentType=WindowsRuntime] | Out-Null

    [Windows.Devices.Radios.RadioAccessStatus,Windows.System.Devices,ContentType=WindowsRuntime] | Out-Null
    Await ([Windows.Devices.Radios.Radio]::RequestAccessAsync()) ([Windows.Devices.Radios.RadioAccessStatus]) | Out-Null

    $radios = Await ([Windows.Devices.Radios.Radio]::GetRadiosAsync()) ([System.Collections.Generic.IReadOnlyList[Windows.Devices.Radios.Radio]])
    $bluetooth = $radios | ? { $_.Kind -eq 'Bluetooth' }

    [Windows.Devices.Radios.RadioState,Windows.System.Devices,ContentType=WindowsRuntime] | Out-Null
    Await ($bluetooth.SetStateAsync($BluetoothStatus)) ([Windows.Devices.Radios.RadioAccessStatus]) | Out-Null





    share|improve this answer


























      0














      See this Q&A …



      Turn on/off Bluetooth radio/adapter from cmd/powershell in Windows 10



      [CmdletBinding()] 
      Param
      (
      [Parameter(Mandatory=$true)][ValidateSet('Off', 'On')][string]$BluetoothStatus
      )

      If ((Get-Service bthserv).Status -eq 'Stopped')
      { Start-Service bthserv }

      Add-Type -AssemblyName System.Runtime.WindowsRuntime
      $asTaskGeneric = ([System.WindowsRuntimeSystemExtensions].GetMethods() `
      | ? { $_.Name -eq 'AsTask' -and $_.GetParameters().Count -eq 1 -and $_.GetParameters()[0].ParameterType.Name -eq 'IAsyncOperation`1' })[0]

      Function Await($WinRtTask, $ResultType)
      {
      $asTask = $asTaskGeneric.MakeGenericMethod($ResultType)
      $netTask = $asTask.Invoke($null, @($WinRtTask))
      $netTask.Wait(-1) | Out-Null
      $netTask.Result
      }

      [Windows.Devices.Radios.Radio,Windows.System.Devices,ContentType=WindowsRuntime] | Out-Null

      [Windows.Devices.Radios.RadioAccessStatus,Windows.System.Devices,ContentType=WindowsRuntime] | Out-Null
      Await ([Windows.Devices.Radios.Radio]::RequestAccessAsync()) ([Windows.Devices.Radios.RadioAccessStatus]) | Out-Null

      $radios = Await ([Windows.Devices.Radios.Radio]::GetRadiosAsync()) ([System.Collections.Generic.IReadOnlyList[Windows.Devices.Radios.Radio]])
      $bluetooth = $radios | ? { $_.Kind -eq 'Bluetooth' }

      [Windows.Devices.Radios.RadioState,Windows.System.Devices,ContentType=WindowsRuntime] | Out-Null
      Await ($bluetooth.SetStateAsync($BluetoothStatus)) ([Windows.Devices.Radios.RadioAccessStatus]) | Out-Null





      share|improve this answer
























        0












        0








        0






        See this Q&A …



        Turn on/off Bluetooth radio/adapter from cmd/powershell in Windows 10



        [CmdletBinding()] 
        Param
        (
        [Parameter(Mandatory=$true)][ValidateSet('Off', 'On')][string]$BluetoothStatus
        )

        If ((Get-Service bthserv).Status -eq 'Stopped')
        { Start-Service bthserv }

        Add-Type -AssemblyName System.Runtime.WindowsRuntime
        $asTaskGeneric = ([System.WindowsRuntimeSystemExtensions].GetMethods() `
        | ? { $_.Name -eq 'AsTask' -and $_.GetParameters().Count -eq 1 -and $_.GetParameters()[0].ParameterType.Name -eq 'IAsyncOperation`1' })[0]

        Function Await($WinRtTask, $ResultType)
        {
        $asTask = $asTaskGeneric.MakeGenericMethod($ResultType)
        $netTask = $asTask.Invoke($null, @($WinRtTask))
        $netTask.Wait(-1) | Out-Null
        $netTask.Result
        }

        [Windows.Devices.Radios.Radio,Windows.System.Devices,ContentType=WindowsRuntime] | Out-Null

        [Windows.Devices.Radios.RadioAccessStatus,Windows.System.Devices,ContentType=WindowsRuntime] | Out-Null
        Await ([Windows.Devices.Radios.Radio]::RequestAccessAsync()) ([Windows.Devices.Radios.RadioAccessStatus]) | Out-Null

        $radios = Await ([Windows.Devices.Radios.Radio]::GetRadiosAsync()) ([System.Collections.Generic.IReadOnlyList[Windows.Devices.Radios.Radio]])
        $bluetooth = $radios | ? { $_.Kind -eq 'Bluetooth' }

        [Windows.Devices.Radios.RadioState,Windows.System.Devices,ContentType=WindowsRuntime] | Out-Null
        Await ($bluetooth.SetStateAsync($BluetoothStatus)) ([Windows.Devices.Radios.RadioAccessStatus]) | Out-Null





        share|improve this answer












        See this Q&A …



        Turn on/off Bluetooth radio/adapter from cmd/powershell in Windows 10



        [CmdletBinding()] 
        Param
        (
        [Parameter(Mandatory=$true)][ValidateSet('Off', 'On')][string]$BluetoothStatus
        )

        If ((Get-Service bthserv).Status -eq 'Stopped')
        { Start-Service bthserv }

        Add-Type -AssemblyName System.Runtime.WindowsRuntime
        $asTaskGeneric = ([System.WindowsRuntimeSystemExtensions].GetMethods() `
        | ? { $_.Name -eq 'AsTask' -and $_.GetParameters().Count -eq 1 -and $_.GetParameters()[0].ParameterType.Name -eq 'IAsyncOperation`1' })[0]

        Function Await($WinRtTask, $ResultType)
        {
        $asTask = $asTaskGeneric.MakeGenericMethod($ResultType)
        $netTask = $asTask.Invoke($null, @($WinRtTask))
        $netTask.Wait(-1) | Out-Null
        $netTask.Result
        }

        [Windows.Devices.Radios.Radio,Windows.System.Devices,ContentType=WindowsRuntime] | Out-Null

        [Windows.Devices.Radios.RadioAccessStatus,Windows.System.Devices,ContentType=WindowsRuntime] | Out-Null
        Await ([Windows.Devices.Radios.Radio]::RequestAccessAsync()) ([Windows.Devices.Radios.RadioAccessStatus]) | Out-Null

        $radios = Await ([Windows.Devices.Radios.Radio]::GetRadiosAsync()) ([System.Collections.Generic.IReadOnlyList[Windows.Devices.Radios.Radio]])
        $bluetooth = $radios | ? { $_.Kind -eq 'Bluetooth' }

        [Windows.Devices.Radios.RadioState,Windows.System.Devices,ContentType=WindowsRuntime] | Out-Null
        Await ($bluetooth.SetStateAsync($BluetoothStatus)) ([Windows.Devices.Radios.RadioAccessStatus]) | Out-Null






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 7 at 0:02









        postanote

        92023




        92023






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Super User!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1381354%2fhow-to-toggle-win10-bluetooth-off-and-on-at-startup%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Plaza Victoria

            In PowerPoint, is there a keyboard shortcut for bulleted / numbered list?

            How to put 3 figures in Latex with 2 figures side by side and 1 below these side by side images but in...