window10/11 dial-up connection broadband connection open hotspot

How to open a hotspot in window10/window11 dial-up connection (broadband connection)

The computer is connected to the broadband connection and can access the Internet, but the Ethernet is not connected to the Internet and cannot open the hotspot. Because dial-up connections and broadband connections do not support hotspots, but there is no router yet, and I want my computer to open a hotspot for other devices.

 

Broadband Internet can be shared to the mobile hotspot's local network.

1. First use your mobile phone to open a hotspot for the computer. After the computer is connected to WiFi, open the hotspot and then proceed to the next step.

Turn on the hotspot on your computer in Control Panel > Network and Internet > Network and Sharing Center > Change Adapter Settings. You can enter the network connection and see that there is a local network * 10 (the following numbers will be different)

 

 

2. Right-click the 'Properties' of 'Broadband Connection', select 'Sharing', and share the network to the 'Local Network' of the hotspot*10

 

For Home Network Connection (H), select the local network. Click to check "√Allow other network users to connect through this computer's Internet connection (N)" and OK.

 

At this time, you will see that the broadband connection has an additional 'shared' one, and the broadband network will be shared to the local network where the hotspot is turned on.

 

At this time, the mobile phone can turn off the hotspot, connect to the computer's hotspot WiFi, and use WiFi to surf the Internet normally.

 

The computer may automatically turn off the hotspot after a period of time. At this time, you can refer to this blogger's (102 messages) windows11/windows10 to set up mobile hotspot self-starting (picture and text step-by-step tutorial)_Setting Yang Xiyue's Blog-CSDN Blog Method , if you turn on the hotspot, it will not automatically turn off the hotspot after a while. If you don’t want to start the hotspot automatically when you turn on the computer, you don’t need to add the wifi .bat to C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup.

You can create wifi1.txt notepad on the desktop, then paste the following content: and rename it to wifi .ps1

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])
}

​
​

2. Create another wifi2.txt notepad, and then paste the following content: and rename wifi .bat

powershell.exe -command ^ "& {set-executionpolicy Remotesigned -Scope Process; .'.\wifi.ps1' }"

3. Modify the system policy (important, otherwise the ps1 file cannot be executed)

Since the default policy of Windows system prohibits directly running ps1 script files, you need to modify the system policy first.

Press the shortcut key win+Q to launch the search (there is a magnifying glass search icon in the lower left corner of the computer) and enter:

powershell

A search list appears, find the application Windows PowerShell and select >Run as administrator

 

The following window will pop up, copy and paste the following command, press Enter, type Y according to the prompts, and press Enter to confirm.

set-executionpolicy remotesigned

 

Run the test: First make sure to turn off the mobile hotspot of the computer, click to run wifi.bat on the desktop, a black frame will flash by and disappear, then check whether the hotspot is turned on.

Click to run WiFi.bat to turn on the hotspot, and the computer will not automatically turn off the hotspot after a period of time.

 The information password for setting up the hotspot can still be changed in the computer settings. 

Guess you like

Origin blog.csdn.net/Wu138168188/article/details/129782770