网络图标显示不正常

现象

每次公司网络切ip,会导致短时间内上不了网,等网络恢复时,网络图标却不会自动恢复正常。

解决

以管理员身份运行 PowerShell:

bash 复制代码
1 Restart-Service NlaSvc
2 Restart-Service Dhcp
3 Restart-Service Dnscache

也可以桌面创建个bat文件来执行,bat内容如下

bash 复制代码
@echo off
:: This script will self-correct its encoding and then run the fix.
:: Do not modify the lines below.

set "Me=%~f0"
set "Temp=%temp%\fix_net_tmp.bat"

:: Create a new clean batch file with correct ANSI encoding using PowerShell
powershell -NoProfile -Command "^
    $content = @'
@echo off
title Network Icon Fix
color 0A
cls
echo ==========================================
echo   Running Network Repair...
echo ==========================================
echo.
echo [1/3] Stopping Network Service...
net stop NlaSvc /y >nul 2>&1
echo [2/3] Flushing DNS...
ipconfig /flushdns >nul 2>&1
echo [3/3] Starting Service...
net start NlaSvc >nul 2>&1
timeout /t 2 /nobreak >nul
cls
echo ==========================================
echo   DONE! Icon should be fixed now.
echo   (Wait 3 seconds if it doesn't change immediately)
echo ==========================================
echo.
pause
exit
'@;
    # Write using Default Encoding (ANSI for Chinese Windows)
    [System.IO.File]::WriteAllText('$using:Temp', $content, [System.Text.Encoding]::Default)
"

:: Run the newly created clean file
if exist "%Temp%" (
    call "%Temp%"
    del "%Temp%"
) else (
    echo Error: Failed to create temporary script.
    pause
)
相关推荐
求学中--20 小时前
数据持久化与网络请求全攻略:Preferences、关系数据库、HTTP实战
网络·网络协议·http
牢七20 小时前
链条合集整理
java·开发语言
yantaohk20 小时前
高层住宅只有一根光纤入户,能不能多装几条宽带跑PCDN?
网络
叼烟扛炮20 小时前
C++ 知识点06 inline
开发语言·c++·inline
路溪非溪20 小时前
关于wifi和蓝牙的共存问题
网络
IPDEEP全球代理20 小时前
美国原生IP是什么意思?有什么用?
网络·网络协议·tcp/ip
曹牧20 小时前
C#:同一项目中维护多个版本的代码
开发语言·c#
青山师21 小时前
Java反射深度解析:运行时探查的艺术、代价与工程实践
java·开发语言·面试·反射·java程序员·java核心
skilllite作者21 小时前
Deer-Flow 工作流引擎深度评测报告
java·大数据·开发语言·chrome·分布式·架构·rust
likerhood21 小时前
Java的TimeUnit详细讲解
java·开发语言