网络图标显示不正常

现象

每次公司网络切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
)
相关推荐
Amumu121382 小时前
Js: ES新特性(一)
开发语言·前端·javascript
cm6543202 小时前
C++中的原型模式变体
开发语言·c++·算法
除了辣条不吃辣2 小时前
ABAP 正则表达式
开发语言·正则表达式·abap·alv
wuqingshun3141592 小时前
谈一下Daemon线程
java·开发语言
☆5662 小时前
C++中的策略模式进阶
开发语言·c++·算法
攻城狮在此2 小时前
ARP配置(IP与MAC地址绑定,静态绑定)
网络
Yupureki2 小时前
《Linux系统编程》14.库的制作与原理
linux·运维·服务器·c语言·开发语言·c++
人间打气筒(Ada)2 小时前
go实战案例:如何基于 Conul 给微服务添加服务注册与发现?
开发语言·微服务·zookeeper·golang·kubernetes·etcd·consul
2301_822782822 小时前
嵌入式C++调试技术
开发语言·c++·算法