网络图标显示不正常

现象

每次公司网络切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
)
相关推荐
techdashen6 分钟前
Go设计取舍之四: map不变时能否并发修改不同value
开发语言·后端·golang
小小小米粒14 分钟前
阿姆达尔定律(Amdahl‘s Law)
java·开发语言
知彼解己14 分钟前
Java 版本演进
java·开发语言·spring boot
风样滴男人哟18 分钟前
PHP特性之反射类ReflectionClass机制
android·开发语言·php
深圳市爱派派智能科技有限公司20 分钟前
“高通 QCS8550 嵌入式主板 EC-A8550JD4:48 TOPS 算力上板“
网络·嵌入式·边缘计算·高通·qcs8550·天启智能·ec-a8550jd4
妍妍爱学习22 分钟前
技术破界 数智共生:华为星河AI网络商业峰会5月18日深圳启幕
网络·ai·生态·数智化·峰会
看昭奚恤哭31 分钟前
Flutter 布局核心思想
开发语言·javascript·flutter
nvd1133 分钟前
GCP L4 Passthrough 负载均衡器“假死超时”深度排查复盘
运维·php·负载均衡
funnycoffee1231 小时前
Cisco ip access-list序号重排方法
linux·网络·tcp/ip
IsSh9nj6q1 小时前
Python全栈应用搭建神器magic-dash .新版本介绍
开发语言·python·dash