Diagnostic Policy Service CPU 占用 windows 11

发布于 3 天前  13 次阅读


原文地址

问题出在 Windows 的一个陈年老 BUG 上,就这服务会猛往 system32\sru 下面写文件,需要强制停止服务,删除这个文件夹,然后重启服务。之后这个服务就不会再往里面写日志了。

Reddit 上已经有人写了个脚本干这事

@echo off
echo ... Set DPS service start type to manual ...
echo.
sc config DPS start= demand

echo.
echo ... Find PID of DPS service ...

for /f "tokens=2 delims=[:]" %%f in ('sc queryex dps ^|find /i "PID"') do set PID=%%f

echo.
echo ... Kill DPS service
echo.

taskkill /f /pid %PID%

echo.
echo ... Delete sru Folder ...
echo.

rd /s "%windir%\system32\sru"

echo.
echo ... Set DPS service start type to auto ...
echo.
sc config DPS start= auto

echo.
echo ... Start DPS service ...

sc start DPS
echo.

pause

UPDATE: microsoft fixed that issue and this fix is not longer be neccesary :)

或许明日太阳西下倦鸟已归时