Win11如何开机自启Wifi热点?Win11开机自动启动无线热点教程
Win11如何開機自啟Wifi熱點?近期有用戶的電腦自帶無線網卡,就想設置電腦開機自啟無線熱點,這樣隨時都可以讓其他用戶連接該網絡,那么應該如何設置呢?我們一起來看看這篇Win11開機自動啟動無線熱點教程吧。
具體操作如下:
1、首先,按鍵盤上的【 Win + X 】組合鍵,或右鍵點擊任務欄上的【Windows徽標】,在打開的右鍵菜單項中,選擇【終端(管理員)】;
2、用戶賬戶控制窗口,你要允許此應用對你的設備進行更改嗎?點擊【是】;
3、管理員:Windows PowerShell窗口,輸入并執行以下命令:
set-executionpolicy remotesigned
4、打開文件資源管理器,并在地址欄輸入:
%appdata%\Microsoft\Windows\Start Menu\Programs\Startup
5、打開的文件夾中,空白處,點擊【右鍵】,在打開的菜單項中,選擇【新建文本文檔】;
6、新建的文本文檔窗口,輸入以下內容:
01powershell -executionpolicy remotesigned -file "%appdata%\Microsoft\Windows\Start Menu\Programs\pondsihotspot.ps1" 02exit 復制代碼 powershell -executionpolicy remotesigned -file "%appdata%\Microsoft\Windows\Start Menu\Programs\pondsihotspot.ps1" exit
7、點擊左上角的【文件】,在打開的下拉項中,選擇【另存為】;
8、另存為窗口,注意兩個地方:
1)文件名填入以【.bat】結尾的名稱,保存類型選擇【所有文件】
2)編碼選擇【ANSI】
最后點擊【保存】。
9、再打開文件資源管理器,并在地址欄輸入:
%appdata%\Microsoft\Windows\Start Menu\Programs
10、打開的文件夾中,空白處,點擊【右鍵】,在打開的菜單項中,選擇【新建文本文檔】;
11、新建的文本文檔窗口,輸入以下內容:
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"Hotspot is already On!" 18} 19else{ 20"Hotspot is off! Turning it on" 21Await ($tetheringManager.StartTetheringAsync()) ([Windows.Networking.NetworkOperators.NetworkOperatorTetheringOperationResult]) 22} 復制代碼 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]) }
再點擊左上角的【文件】,打開的下拉項中,選擇【另存為】;
12、另存為窗口,注意兩個地方:
1)文件名填入以【.ps1】結尾的名稱,保存類型選擇【所有文件】
2)編碼選擇【ANSI】
最后點擊【保存】。
最后運行【wifi.bat】,測試能否打開熱點。
總結
以上是生活随笔為你收集整理的Win11如何开机自启Wifi热点?Win11开机自动启动无线热点教程的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Win11如何将微软账户改成本地账户?W
- 下一篇: 钉钉后台能查看到什么?钉钉后台查看的内容