FIX: The system cannot find the file specified dcsvc Services.msc

How to fix The system cannot find the file specified for the dcsvc service

I often use Get-Service as an example in my blog posts about PowerShell.

I wanted to do this again, but suddenly ran into an error while getting the Services from my local device.

Get-Service -Name dcsvc

Get-Service: Service 'dcsvc (dcsvc)' cannot be queried due to the following error: 
Get-Service: The system cannot find the file specified.

When trying to open the properties within the Services.msc GUI I got the same error.

FIX: The system cannot find the file specified dcsvc Services.msc
FIX: The system cannot find the file specified dcsvc Services.msc

Fun fact, if you don’t feel like solving this and prefer to suppress the error message within PowerShell, you can use this:

Get-Service -ErrorAction SilentlyContinue

Let’s fix ‘The system cannot find the file specified‘!

I have two ways of fixing this, one will use the GUI and the other will use PowerShell.

Eventually PowerShell will be easier and less chance for a spelling mistake (since you will copy mine), but the GUI is more clear to understand what’s happening.

The problem arises because a typo has been made in the registry. The DisplayName refers to a wrong path, so the dcsvc.dll cannot be found and you get the error message.

We will solve this manually via the GUI and via PowerShell I have already typed it out for you and you only have to copy it.


Let’s fix this with Powershell!

Open PowerShell as an administrator and run the command below:

$RegistryPath = 'HKLM:\SYSTEM\CurrentControlSet\Services\dcsvc'
$Name         = 'DisplayName'
$Value        = '@%systemroot%\system32\dcsvc.dll,-101'
$Item = Get-ItemProperty -Path $RegistryPath -Name $Name | Set-ItemProperty -Name $Name -Value $Value

Let’s fix this in the GUI!

Open the Registry Editor (search for it in Start).

Copy the path below in to the Registry Editor:
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\dcsvc

As you can see the Description and DisplayName paths don’t match.

This does not always have to be the case, of course, but since both refer to dcsvc, you can assume that they have forgotten .dll.

And the -101 and -100 don’t match either of course. I don’t know what the 101 or 100 means, so I tried without updating it first, but to no avail.

Open the DisplayName key and update the Value data to this:
@%systemroot%\system32\dcsvc.dll,-101

FIX: The system cannot find the file specified dcsvc Services.msc
FIX: The system cannot find the file specified dcsvc Services.msc

After I have updated the value I can start the service again.

Is this really necessary? No, but at least now you know you won’t get this error anymore!

FIX: The system cannot find the file specified dcsvc Services.msc
FIX: The system cannot find the file specified dcsvc Services.msc

Published by

Bas Wijdenes

My name is Bas Wijdenes and I work as a PowerShell DevOps Engineer. In my spare time I write about interesting stuff that I encounter during my work.

Leave a Reply

Your email address will not be published. Required fields are marked *