时间:2022-05-06 作者:yrz
电脑怎么设置开机自动开启移动热点?设置开机自动开启移动热点让用户通过手机连接wifi更加容易,下面就是小编整理的设置开机自动开启移动热点教程,快来看看吧!
1、鼠标右击屏幕左下角的开始菜单,打开 Windows PowerShell(管理员)(A)
在Windows11中可以打开 Windows终端(管理员)(A)
2、在打开的Windows PowerShell窗口中输入:
set-executionpolicy remotesigned
按下键盘上的回车键(Enter按键)。
3、等待一会,将出现如下的提示。输入:a。然后按下回车键(Enter按键)。
4、关闭Windows PowerShell窗口。
打开资源管理器,并在地址栏输入:
%appdata%\Microsoft\Windows\Start Menu\Programs\Startup
然后按下回车键(Enter按键)。
5、将进入“启动”这个文件夹内。在空白处鼠标右击,选择“新建”,选择“文本文档”。
6、更改新建的这个文件的txt后缀为bat。
7、若是出现下图提示,点击“是”。
8、鼠标右键点击该文件,然后选择“编辑”。
9、在打开的窗口输入以下内容:
01powershell -executionpolicy remotesigned -file "%appdata%\Microsoft\Windows\Start Menu\Programs\pondsihotspot.ps1"
02exit
复制代码
10、在资源管理器的地址栏输入:
%appdata%\Microsoft\Windows\Start Menu\Programs
然后按下回车键(Enter按键),将进入“程序”这个文件夹内。
在空白处鼠标右击,选择“新建”,选择“文本文档”。
更改新建的这个文件名字为“pondsihotspot.ps1”。
若是出现重命名提示,点击“是”。
11、鼠标右键点击该文件,选择“打开方式”,选择“记事本”打开。
12、复制以下内容到文件内,完成后保存并关闭。
01Add-Type -AssemblyName System.Runtime.WindowsRuntime
02$asTaskGeneric = ([System.WindowsRuntimeSystemExtensions].GetMethods() | ? { $_.Name -eq 'AsTask' -and $_.GetParameters().Count -eq 1 -and $_.GetParameters()[0].ParameterType.Name -eq 'IAsyncOperation`1' })[0]
03Function Await($WinRtTask, $ResultType) {
04$asTask = $asTaskGeneric.MakeGenericMethod($ResultType)
05$netTask = $asTask.Invoke($null, @($WinRtTask))
06$netTask.Wait(-1) | Out-Null
07$netTask.Result
08}
09Function AwaitAction($WinRtAction) {
10$asTask = ([System.WindowsRuntimeSystemExtensions].GetMethods() | ? { $_.Name -eq 'AsTask' -and $_.GetParameters().Count -eq 1 -and !$_.IsGenericMethod })[0]
11$netTask = $asTask.Invoke($null, @($WinRtAction))
12$netTask.Wait(-1) | Out-Null
13}
14$connectionProfile = [Windows.Networking.Connectivity.NetworkInformation,Windows.Networking.Connectivity,ContentType=WindowsRuntime]::GetInternetConnectionProfile()
15$tetheringManager = [Windows.Networking.NetworkOperators.NetworkOperatorTetheringManager,Windows.Networking.NetworkOperators,ContentType=WindowsRuntime]::CreateFromConnectionProfile($connectionProfile)
16if ($tetheringManager.TetheringOperationalState -eq 1) {
17""
18}
19else{
20Await ($tetheringManager.StartTetheringAsync()) ([Windows.Networking.NetworkOperators.NetworkOperatorTetheringOperationResult])
21}
10、重启电脑,看下是否可以自动打开移动热点。
以上就是小编为大家带来的Windows教程了!更过好玩的游戏请关注:11ba游戏下载站你想要的,想不到的我们都应有尽有!