This time, I would like to introduce a batch file that reconnects Wi-Fi.
Are you having trouble connecting to Wi-Fi when starting up Windows 10 or Windows 11, and even though it says "Connected," you can't connect to the Internet?
In this case, disconnecting from Wi-Fi and then reconnecting will usually allow you to connect normally.
Batch file to restart Wi-Fi connection
What is a batch file? How to create and run a batch file
@echo off
sc stop WlanSvc
ping -n 5 127.0.0.1>nul
sc start WlanSvc
exit
1. Right-click on the saved batch file and click "Run as administrator."
2. When the "User Account Control" screen appears, click "Yes".
Command Description
| Command | Description |
|---|---|
| sc stop WlanSvc | Stop the WlanSvc service (WLAN AutoConfig). |
| ping -n 5 127.0.0.1>nul | Pause for 5 seconds. |
| sc start WlanSvc | Start the WlanSvc service. |
If you stop the WlanSvc service, the Wi-Fi will be disconnected.Task tray (notification area)The icon will change to a globe icon.

When you start the WlanSvc service, Wi-Fi will connect and the task tray icon will change back to its original icon.


Comment: