Cannot stop the service. Unable to stop Access denied service. Restart via Control Panel

  • 06.01.2022

Hello friends! The other day, once again, I came across an error when starting some system services. Why do I say that again? The thing is, I've already met her. not for the first time, but somehow I could not get to the description of the ways in which I successfully coped with error 5.

So we meet several possible solutions that can help you if you find problems with starting services, namely “ Errors 5. Access Denied". In general, I will first describe the very essence of the error that I am talking about, so that you can determine the same problem you have or something completely different.

So, by opening the services menu and selecting the item I need, I get into their properties, where in the item about how to start the service, I set the value to “Automatically”, and also click on the “Start” button to start it immediately. But alas, instead of a successful start, a small window is displayed on the screen, with a rather strange message that the service could not be started due to "Error 5. Access denied".

This message surprised me because it said about the lack of rights, although I worked at the computer, logging in using the system administrator account, and as you know, there are all possible rights to change the properties and settings of the operating system.

How to solve the problem with Error 5?

There are quite a few solutions to this kind of problem, namely, fixing the causes of the “error 5. Access denied” when starting services, it all depends on the situation the user is facing. Further, as usual, I will not describe one hundred percent method that will help everyone, since there is none, but I will write about how I got out of this situation with a positive result.

I found some examples of fixing error 5 on the net, but I got to others myself. In general, let's see what in my practice helped to get rid of problems with starting services, but if you try to do the same for yourself, maybe one of the options I suggested will suit you.

"Error 5. Access denied" when starting system services, solutions

1. Opening full access to the "C" drive. I don’t know why, but I came across computers where the system disk security was set to read-only and nothing else, and this parameter was set for all accounts. But, as soon as I returned all the security checkboxes, error 5 disappeared forever, but the service started its work without any problems.

To return the rights, you need to get into the properties window of the system drive "C" and go to the tab " Security". Having missed the list of users and groups, we go down to the "Edit" - "Add" buttons.

In the area that appears, use your hands on the keyboard to type the word " Everything”, which means that we will set the same access rights for absolutely all users of the system.

If everything is so, then in the previous step you did not make mistakes, click on "OK".

For those who are still Windows XP users, you should pay attention to the fact that by default you may not see the "Security" tab. In order to return it to its place, follow a few simple steps.

  1. Open any folder;
  2. Click on "Service" at the top.
  3. "Folder properties";
  4. "View";
  5. In the list of additional options, uncheck the use of simplified sharing.

After that, we perform the above described actions and, of course, we check whether you managed to cope with the error5 using this method or not.

2. Also, there is another way that I got on the Microsoft support pages. Seeing this tip in the comments, I decided to try it and the problem with error 5 when starting the service was solved.

The first step is to open a command prompt as an administrator, but if you are on this account, then you can not worry and just open cmd using "Run".

Now in the window that appears, write this: net localgroup administrators /add networkservice (Important: if you have English. OS then instead of Admin. specify Administrator) and press the Enter key.

Then we do this: net localgroup Administrators /add localservice . (Administrators)

When finished with the commands, close the command prompt window and restart the computer.

If the commands were entered correctly and you were lucky, then error 5 preventing the services from starting should disappear, and the services themselves will start without any access denied messages.

3. We are trying to fix the error with denied access when starting services using the registry of the operating system.

But, before we rush to chop up our registry, we first need to find out the name of the service that does not want to start. To do this, in the list of services, open the properties of the service we need and look at the line " Service name". Having remembered it, we proceed directly to working with the registry.

Registry Editor - launch it using the "Run" window. If you do not understand what it is, then you.

You should see a large list of services in alphabetical order. In order to understand what kind of service we need, I said to look at its name in the properties. So we are looking for a section with the appropriate name, right-click to call up the section menu and select the line " Permissions».

The same security setting as I described in the first paragraph should be displayed. In general, we look to ensure that full access is set in the "Administrators" and "Users" groups.


If they are not there at all, then we fix this matter, in the same way as I showed it at the beginning of the article.

4. Let's consider one more point, which is also related to access to the C drive, only this time not to all users, namely LOCAL SERVICE.

So, again we go into the security properties of the system disk. Next, after the list of users and groups, click on the "Add" button.

In the window that appears, click on "Search". As a result, a list should appear from which we need to select "" and click on the "OK" buttons.

This group should be added to the user's list, now for going down a little lower to the "Permissions for LOCAL" window, set all possible checkboxes and apply the changes.

In theory, the service should start after that, but error 5, disappear without a trace.

5. Alternatively, you can also disable or remove your antivirus and try to start the service without it. The fact is that some antivirus programs, in addition to software, install additional services of their own that could take away your rights to enable or disable some local services.

6. Well, of course, the one hundred percent option is, I know that it will not work for everyone, but I can tell you with confidence that it will definitely help get rid of error 5 with denial of access to start the service, well, and additionally save the computer from various other glitches and problems 🙂

On this I will probably finish my article, but if at least one of the above options helps you, then do not forget to join us

I think that most users have encountered such a problem as freezing services in Windows, moreover, an attempt to forcefully terminate such a service has not been successful, and it hangs in the mode Stopping. From the graphical interface, restarting or forcibly terminating the service also fails, and restarting the server itself, in our case, the computer, may not always be valid.

Now we will look at a method that will help you force quit a process that is frozen, while the device itself does not need to be restarted.

How to force quit a hung service?

So, as soon as 30 seconds pass and it is clear that the service has not stopped, Windows will display the following message:

You can quickly and effortlessly shut down a hung process using the utility. Before that, you will need to define PID process (service). As an example, we will use the service, the system process name is wuauserver.

Attention! If you end an important process, then it can lead to a system reboot or BSOD (screen of death).

Now we open the command line with admin rights, if this is not done, then an error may occur. Enter the following into the command line:


A message will appear that the Windows Update service has ended. You can then return to the service management and start the process there again, or delete it altogether if you do not use it.

There is another method for forcefully terminating a process without having to find out the PID. In this case, the already familiar utility will help us. Let's run it as an administrator.

The following command will help us identify services that are in the stopping state:

Get-WmiObject -Class win32_service | Where-Object ($_.state -eq 'stop pending')


Now we need to complete the process for the services we found, this will help us. With the help of the following script, all services hanging in the system will be terminated:

$Services = Get-WmiObject -Class win32_service -Filter "state = 'stop pending""
if ($Services) (
foreach($service in $Services)(
try(
Stop-Process -Id $service.processid -Force -PassThru -ErrorAction Stop
}
catch(
Write-Warning -Message » Error. Error details: $_.Exception.Message"
}
}
}
else(
Write-Output "No services with 'Stopping'.status"
}


That's all, today we were able to complete the processes that we could not complete, for example, using the device manager or from the graphical shell.

System administrators usually have to deal with the need to force shutdown of services, but it may well turn out that during some kind of configuration you will need to perform such an operation - ordinary user. You open the service management console, find the service that needs to be stopped or restarted, click the corresponding link in the left panel, but instead of safely stopping or restarting the service hangs in the status "Stop".

And he doesn't react to anything. And later 30 seconds you get the following message:

Failed to stop NAMESERVIS Windows service on local computer.
Error 1053. The service did not respond to the request in a timely manner.

The first thing that comes to mind is to reboot the computer. This usually helps, but it may well turn out that a second attempt to stop the service will fail and lead to it hanging up again, or restarting is impossible for some reason. In this case, there is nothing left but to complete its work in forced mode.

For starters, you can try using the most common task manager. Open the dispatcher, find the unresponsive service, right-click on it and select the option from the context menu.

This action will redirect you to the service process, which you can then terminate in forced mode .

You can also shut down the service through the command line launched as administrator using the standard utility taskkill. The command looks like this:

taskkill /PID Service # /F

peep PID you can in the task manager tab "Services" or by running the command sc queryex name , where name- systemic (Latin) service name.

The result of the command taskkill from PID and parameter F should be a message "Process, with id completed successfully" .

author Victoria Gromada asked a question in Other languages ​​and technologies

How to disable the antivirus through the task manager, if it says that access is denied? and got the best answer

Answer from Jide[guru]
try disabling the "self-defense" of the antivirus if there is one and mock it as you want!

Answer from 2 answers[guru]

Hey! Here is a selection of topics with answers to your question: How to disable the antivirus through the task manager, if it says that access is denied?

Answer from uriy[guru]
You boot in safe mode - start-run-msconfig-in autoload, uncheck the antivirus, reboot.
After that, you can uninstall using Revo Uninstaller Pro or IObit Uninstaller


Answer from Sergey V. Voronin[guru]
Control Panel - Add/Remove Programs. If it doesn’t work there, then find and disable it in the services.
And the file is there, if it is listed in the manager. For example, through the far-manager, you can see exactly how the file of this process is called and where it is located.


Answer from shade[expert]
Most likely, it will not be possible to stop it through the task manager. Since most modern antiviruses run as services (service).
To stop the service, you need to go to the service control window (Control Panel -> Administrative Tools -> Services). Find the service responsible for the antivirus and select "stop" (stop service)

How to terminate a Windows service process stuck in stopping status? I think most Windows administrators have encountered situations where, when trying to stop (restart) a service from the graphical interface of the Services Management Console (Services.msc), the service freezes tightly and hangs in the status Stopping. After that, you cannot stop the service in the console, because service action buttons become unavailable. The easiest way is to restart the server, but this is not always acceptable. Consider an alternative way to force quit a hung service or process without the need for a reboot.

If within 30 seconds after trying to stop the service, it does not stop, Windows displays a message:

Failed to stop xxxxxxx Windows service on local computer.
Error 1053. The service did not respond to the request in a timely manner.

Windows Could not stop the xxxxxx service on Local Computer
Error 1053: The service did not respond in a timely fashion.

When you try to stop such a service with the command: net stop wuauserv, a message appears:

The service is starting or stopping. Please try again letter.

Ending a hung service with TaskKill

The easiest way to end a hung service is to use the utility taskkill. First of all, you need to determine PID(process id) of our service. Let's take the Windows Update service as an example, its system name is wuauserver(the name can be found in the service properties in the services.msc console).

Quite often this problem happens especially after installing updates on Windows Server 2012 R2 / 2008 R2.

Important. Be careful. Forcibly quitting a critical Windows service process can result in a BSOD or a system reboot.

On the command line with administrator rights (this is important, otherwise there will be an access denied error):
sc queryex wuauserv

In this case, the PID of the process is 816.

To force quit a hung process with PID 816:

taskkill /PID 816 /F

SUCCESS: The process with PID 816 has been terminated.

This command will forcefully terminate the service process. In the future, you can return to the service management console and manually start the service (or completely, if it is not needed).

Headshotting a hung service can be done more elegantly without having to manually determine the PID of the process. The taskkill utility has a /FI option that allows you to use a filter to select the required services or processes. You can stop a specific service with the command:

TASKKILL /F /FI “SERVICES eq wuauserv”

Or you can omit the service name at all by ending all services in a hung state with the command:

taskkill /F /FI “status eq not responding”

After that, the service hung in the Stopping status should stop.

Force termination of a hung service from PowerShell

You can also use PowerShell to force stop the service. You can get a list of services that are in the Stopping state with the following command:

Get-WmiObject -Class win32_service | Where-Object ($_.state -eq "stop pending")

The cmdlet will help you end the process for all found services. stop-Process. Combining both operations into a loop, we get a script that automatically terminates all processes of suspended services in the system:

$Services = Get-WmiObject -Class win32_service -Filter "state = "stop pending""
if ($Services) (
foreach($service in $Services)(
try(
Stop-Process -Id $service.processid -Force -PassThru -ErrorAction Stop
}
catch(
Write-Warning -Message " Error. Error details: $_.Exception.Message"
}
}
}
else(
Write-Output "No services with "Stopping".status"
}

Analyzing Hanging Processes with Resmon

You can determine the process that is causing the service to hang using the resmon resource monitor.


Process Explorer: Terminating a hung process from under SYSTEM

Some processes launched under SYSTEM cannot be terminated even by the local server administrator. The fact is that he simply may not have rights to some processes or services. To terminate such process (services), you need to grant rights to the service (process) to the local Administrators group, and then terminate them. To do this, we need two utilities: psexec.exe and ProcessExplorer (available on the Microsoft website).