轻松几步变开机自动启动怎么改开机自动启动
Win10系統自帶了移動熱點功能,配備無線網卡的電腦,直接點擊移動熱點就可以使用手機等設備共享本地網絡連接wifi上網了。但是移動熱點每次開機都需要再次點擊才能打開熱點,下面就是如何配置開機自動啟動移動熱點的方法。
1、鼠標右擊Win10屏幕左下角的開始菜單,或者按Win+X彈出隱藏菜單,打開Windows PowerShell(管理員)(A),在Windows11中可以打開 Windows終端(管理員)
2、在打開的Windows PowerShell窗口中輸入:set-executionpolicy remotesigned
然后按下回車鍵確定
3、確定后將出現如下的提示。輸入‘a’然后按下回車鍵。關閉Windows PowerShell窗口。
4、在資源管理器地址欄輸入:%appdata%\Microsoft\Windows\Start Menu\Programs\Startup 然后按下回車鍵進入“啟動”文件夾,空白處新建一個文本文檔,在文本中輸入以下內容:
powershell -executionpolicy remotesigned -file "%appdata%\Microsoft\Windows\Start Menu\Programs\開啟熱點.ps1"
exit
5、關閉并保存文本文檔,把文檔名稱改為“開機啟動熱點”,后綴名.txt改為.bat。
6、在資源管理器的地址欄輸入:%appdata%\Microsoft\Windows\Start Menu\Programs
然后按下回車鍵進入“程序”文件夾,在空白處新建一個文本文檔,在文檔中輸入以下內容:
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
}
Function AwaitAction($WinRtAction) {
$asTask = ([System.WindowsRuntimeSystemExtensions].GetMethods() | ? { $_.Name -eq 'AsTask' -and $_.GetParameters().Count -eq 1 -and !$_.IsGenericMethod })[0]
$netTask = $asTask.Invoke($null, @($WinRtAction))
$netTask.Wait(-1) | Out-Null
}
$connectionProfile = [Windows.Networking.Connectivity.NetworkInformation,Windows.Networking.Connectivity,ContentType=WindowsRuntime]::GetInternetConnectionProfile()
$tetheringManager = [Windows.Networking.NetworkOperators.NetworkOperatorTetheringManager,Windows.Networking.NetworkOperators,ContentType=WindowsRuntime]::CreateFromConnectionProfile($connectionProfile)
if ($tetheringManager.TetheringOperationalState -eq 1)
{
"Hotspot is already On!"
}
else{
"Hotspot is off! Turning it on"
Await ($tetheringManager.StartTetheringAsync()) ([Windows.Networking.NetworkOperators.NetworkOperatorTetheringOperationResult])
}
7、關閉并保存文本文檔,修改文檔名稱為“開啟熱點”,后綴名.txt改為.ps1
8、重啟電腦就能開機自動啟動移動熱點了,如果安裝了殺毒軟件,記得把“開機啟動熱點.bat”添加為信任項即可。
總結
以上是生活随笔為你收集整理的轻松几步变开机自动启动怎么改开机自动启动的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 登录系统_执照管理系统登录与执照转换操作
- 下一篇: 如何提升远程办公的工作效率如何提升远程办