- 新建脚本,写入下面的代码,保存为 ***.ps1
# 声明变量
$connectionProfile = [Windows.Networking.Connectivity.NetworkInformation,Windows.Networking.Connectivity,ContentType=WindowsRuntime]::GetInternetConnectionProfile()
$tetheringManager = [Windows.Networking.NetworkOperators.NetworkOperatorTetheringManager,Windows.Networking.NetworkOperators,ContentType=WindowsRuntime]::CreateFromConnectionProfile($connectionProfile)
# 开启热点
$tetheringManager.StartTetheringAsync()
- 创建win10任务计划,开机自动执行该脚本即可。
网友评论