全网唯一:surfacepro系列用户重启或解锁后蓝牙失灵终极解决方法【绝对有效】

百度了无数次,surface pro 7 的解锁蓝牙失灵问题已经成为苏菲系列的通病
研究了一个小时,终于做出了针对苏菲蓝牙失灵问题的补丁。
分析:Windows10只有在用户长时间未登录时会产生此问题,


【伸手党福利】直接放一个补丁下载地址:
https://download.csdn.net/download/wwppp987/15506813
解压到c盘根目录(目录已经创建好了,直接解压即可),然后将xml文件导入到计划任务中即可。


本补丁针对win10,别的版本请看下原理,原理是相通的。

1、powershell开权限

C:\Windows\WinSxS
下搜索powershell.exe,右键使用管理员权限运行

在这里插入图片描述
输入

Set-ExecutionPolicy Unrestricted

选择全是【a】
在这里插入图片描述
否则之后运行程序会报错

项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次

参考:https://blog.csdn.net/f786587718/article/details/76762461

2、建立C:\BlueTeethReboot文件夹并建立三个文件:

在这里插入图片描述
三个文件内容:
1.bat

@echo off
powershell -command C:\BlueTeethReboot\1.ps1 -BluetoothStatus Off
choice /t 1 /d y /n >nul
powershell -command C:\BlueTeethReboot\1.ps1 -BluetoothStatus On

1.ps1

[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

1.vbs

set ws=WScript.CreateObject("WScript.Shell")

ws.Run "c:\BlueTeethReboot\1.bat",0

这三个文件的目的是重启蓝牙模块,根手动关闭和打开没有区别。

3、建立计划任务

在计划任务中,找到Microsoft》Windows下,右键》创建基本任务
1、填写名字,
2、当前用户登录时
在这里插入图片描述
3、启动程序
在这里插入图片描述
4、选择1.vbs
在这里插入图片描述
5、创建完成,然后右键》属性》勾选使用最高权限运行、隐藏
在这里插入图片描述
6、完成效果图:
在这里插入图片描述


效果:用户在登录时候自动关闭1秒后重启蓝牙模块。
导致用户在系统登录之初蓝牙掉线,但是恢复速度很快,总体掉线时间一般不会超过2秒。
对于苏菲这种非性能笔记本来说这点时间我还是等得起的。

优点:用户锁屏时候不会运行此脚本,而是在用户注销或者重启机器时候运行。
强烈推荐拥有苏菲的同志们使用此脚本~~

  • 5
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 15
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 15
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值