New
#1
Fix high cpu usage caused by diagnostic policy service
Hello,
as mentioned in another thread reply I found a solution by someone for this common problem with high cpu usage by a windows service. In the folder "C:\Windows\system32\sru" are constantly created log files and the directory becomes very large over time. Then I stopped the service, I even needed to force kill the process via taskmanager because the service was too busy The service is part of the svchost process structure so you first need to find the corresponding PID of process. It is much safer via cmd and then "sc stop dps". Then you can delete the whole folder C:\Windows\system32\sru. When you start the service afterwards the folder stays empty or even gone. For me it did not affect the service, troubleshooting does still work and cpu usage is now low
I attached a Batch which finds the pid of the dps service and stops the service. The it promps the user to delete the folder "sru" and starts the service after that.
You can also use the code below and paste it in a new text file. Then rename suffix from *.txt to *.bat and run with admin privileges.
Code:@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