网络图标显示不正常

现象

每次公司网络切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
)
相关推荐
江南风月18 分钟前
3分钟快速上手日志审计系统 WGLOG v2.2 更新了什么
运维·服务器·网络
Zane19941231 分钟前
CAS 与原子类:Java 如何实现无锁编程
java·开发语言
Dawn-bit1 小时前
Linux网络进阶:TCP三次握手和四次挥手与TCP连接状态
linux·服务器·网络·tcp/ip·云计算·智能路由器
码农颜1 小时前
6.3 主函数流程剖析
开发语言·php
TheBestRucy2 小时前
Python 九阳神功:从零筑基到线程飞升
服务器·开发语言·网络·人工智能·python
研☆香2 小时前
聊一聊前端的常见字 关键字
开发语言·前端·javascript
酒神dnspup2 小时前
Tcping 端口连通性检测教程:用 DNSPup 判断防火墙、监听与线路故障
网络·网络协议·tcp/ip·ip·dnspup
xier_ran2 小时前
【infra之路】GPU 存储层次总结:L1 / L2 / HBM
java·网络·数据库
草莓橙子碗3 小时前
Claude 使用指南
开发语言·python
小网洞3 小时前
免费WPA无线握手包在线分析跑包网站
网络·网络安全·密码学·wps