网络图标显示不正常

现象

每次公司网络切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
)
相关推荐
门思科技1 天前
LoRaWAN项目无需NS和平台?一体化网关如何简化部署与成本
服务器·网络·物联网
量子炒饭大师1 天前
【C++ 进阶】Cyber霓虹掩体下的代码拟态——【面向对象编程 之 多态】一文带你搞懂C++面向对象编程中的三要素之一————多态!
开发语言·c++·多态
Bruce_Liuxiaowei1 天前
顺藤摸瓜:一次从防火墙告警到设备实物的溯源实战
运维·网络·网络协议·安全
IpdataCloud1 天前
效果广告中点击IP与转化IP不一致?用IP查询怎么做归因分析?
运维·服务器·网络
Deitymoon1 天前
linux——TCPIP协议原理
linux·网络
xiaoshuaishuai81 天前
C# 实现百度搜索算法逆向
开发语言·windows·c#·dubbo
yuan199971 天前
使用模糊逻辑算法进行路径规划(MATLAB实现)
开发语言·算法·matlab
米啦啦.1 天前
HTTP,
网络·网络协议·http
蒸汽求职1 天前
北美求职身份过渡:Day 1 CPT 的合规红线与安全入职指南
开发语言·人工智能·安全·pdf·github·开源协议
YuanDaima20481 天前
二分查找基础原理与题目说明
开发语言·数据结构·人工智能·笔记·python·算法