dns client restart greyed out

https://answers.microsoft.com/en-us/windows/forum/windows_10-other_settings/grayed-out-services-in-windows-10/346bd141-13e2-42de-b93a-c4481b23ec43?page=2

I found the I was able to use regedit to disable dnscache.

I will say that it is ridiculous to lose the ability to change this from the services control panel. I also tried disabling it using msconfig and even unchecking the box didn't disable it.

Here are the directions the finally worked.

win+x run regedit

Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Dnscache and locate Start registry key

Change Startup type :

Automatic -2 Manual -3 Disabled -4 Automatic (Delayed Start) -2


Restart Dnscache in new Windows 10 (where Dnscache placed in isolated process) via PowerShell:

$ServicePID = (get-wmiobject win32_service | where { $_.name -eq 'Dnscache'}).processID
Stop-Process $ServicePID -Force

Place code:

PowerShell.exe -WindowStyle Hidden -NoProfile -NoLogo -Command "try { $ServicePID = (get-wmiobject win32_service | where { $_.name -eq 'Dnscache'}).processID; Stop-Process $ServicePID -Force } catch {}"

into bat-file and this able to automatization.