The windows service started and then stopped

The Windows Defender Service on Local Computer started and then stopped.

When attempting to start defender in services.msc I get this message: The Windows Defender Serviceservice on Local Computer started and then stopped. Some services stop automatically if they are not in use by services or programs.

This started after today’s update 8/7/2015.

I was able to start Windows Defender Network Inspection Service but it says startup type is Manual. That doesn’t seem right.

Replies (6) 

Thank you for being part of Windows 10 family.

Sorry to know that you are facing issues with Windows 10.

In order to help you better, please provide the information:

Have you installed any third party security software on the Computer?

If so, then i would suggest you to disable or uninstall the third party security software and check if the issues persist.

Disable Anti virus:

NOTE: Antivirus software can help protect your computer against viruses and other security threats. In most cases, you shouldn’t disable your antivirus software. If you have to temporarily disable it to install other software, you should re-enable it as soon as you’re done. If you’re connected to the Internet or a network while your antivirus software is disabled, your computer is vulnerable to attacks.

Refer to the below methods and check if it helps.

Method 1: I suggest you to perform the system maintenance troubleshooter. It will resolve the common system problems.
1. Tap on Windows Key and click on search bar.
2. Type “Troubleshooting” without the quotes and click on Troubleshooting.
3. Then click on System and Security.
4. Click on System Maintenance.
5. Click on Next and follow the prompts to run the troubleshooter.

If the issue still persist, refer to the below method.

Method 2 : I suggest you to perform a System File Checker of the Computer and check if it helps.

1. Press Windows Key.

2. Then type “CMD ” without the quotes and right click on it.

3. Select Run as Administrator .

4. Then type” sfc /scannow ” without the quotes and hit on Enter Key .

If the issues still persist, refer to the below methods.

Читайте также:  Просмотр фотоальбома windows server 2012 не работает

Reply with the information, so that we can help you better.
Hope it helps. Contact us if you need any further assistance, we will be glad to help.

The windows service started and then stopped

This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.

Answered by:

Question

I have a windows service and it was working fine, and today I tried to stop it and unlike the usual stop process, this one took a longer time. The next time I want to start the windows service, it raise an error that the service started and then stopped, it also said that service with no job stops automatically. When I checked the event log, there is no event about my service. My service worked well yesterday, in fact, it worked as usual just before I tried to stop it . but then I don’t know why the error appeared, I don’t think I did any changes to the database..

Any solutions ? or if someone can share his/her own problem similar to this

What my windows service do: read a log file, write to log file, then access database, then execute a stored procedure in 2 hours interval..

Edit: I even tried to restart my computer after the problem keep happening when i try to start the service, but it doesn’t solve the problem.. now I cant start my service. One way I found to solve this problem is by re-installing the service. However, I need a better solution because I don’t want to keep re-installing the service if this problem appeared.

C# Windows Service — the service on local computer started and then stopped?

I am trying to create my first Windows Service, but so sad. after I started the service manually from services.msc, the message ‘the service on local computer started and then stopped. some services stop automatically is they have no work to do’

I am sure there must be some mistake in my code.

Forgive me if i did silly mistakes. This is my very very first Windows Service.

PS. I have already ticked ‘Allow service to interact with desktop’

3 Answers 3

Check to make sure the account your service runs under can access those files (including write access for the .wav and .mp3 files).

Your code might also be causing an unhandled exception. I’m not sure, but that might be visible in the event log. You can also get your service to write out messages explicitly to the event log (like in the case of an exception); check out this link: http://www.codeproject.com/KB/dotnet/simplewindowsservice.aspx

Читайте также:  Mysql log viewer windows

You didn’t create a running thread for the OnStart method. Basically, the service manager calls OnStart to start the service, and that call needs to finish in about 15 seconds or so. Internally, you should create a thread with a loop that actually calls your code over time. Like so:

Your service doesn’t really follow the pattern; you’re not doing things continuously, and that should be more of a console program.

Effectively, it’s because your service stopped doing anything as soon as you finished the OnStart method. It’s like what happens when you finish Main in a console program — the application just exited.

Windows service on Local Computer started and then stopped error

Usually, I get this error: (The «service name» service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other service or programs) when there’s something wrong with my code, like non-existing drive paths, etc. The windows service will not start.

I have a windows service that backs up folder/files, to a location if it reached the size limit. Details are all provide by an XML Configuration that the windows service reads on start. I have a separate windows forms that has a button that does exactly what my windows service’s onstart is doing. I use my windows forms for debugging the code before I put it in my windows service.

When I start my windows forms. It does what it suppose to do. When I put my code in the windows service OnStart() method the error showed up.

I don’t know what keeps the windows service not starting, the windows form simulator worked fine. What seems to be the problem?

UPDATE: After many trials I’ve noticed that using only a folder directory (w/out file), the windows service doesn’t work. When I replaced the fileWatch variable with a specific file (including its directory), the windows service started. When I changed it back to a folder location, it didn’t work. What I think is that folder locations doesn’t work in a filewatcher.

When I tried creating a new windows service that watches a folder location, it worked.. However, when I tried the same location in my original windows service, it didn’t work! I was mindf$#*ed! It seems that I have to create a new windows service and build the installer everytime I place a new code/function.. This way I can keep track where I get an error.

C# Windows Service — Started and then Stopped Automatically

I am creating this windows service by following the instructions at MSDN Walkthrough: Creating a Windows Service and after successful installation, I go to Services.msc to Start the Windows service and before it finishes starting up I get the following message:

The EIWindowsService service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs.

I know the Windows Service starts ok because there is an entry to the log file stating that the service started. I did some research before posting on here and the answer from Some Services Stop Automatically states that the problem could either be that the OnStart method is throwing an error, or that the OnStart is not kicking off a thread. So I modified my code so that the only thing within the OnStart is the starting of two timers and the log entry therefore needing no exception handling. I also added a thread to «jump» to another method.

Читайте также:  Ассистент миграции windows для mac os mojave

I tried the windows service again and I know that it «moved» to the new method that the thread pointed to because I had a log entry in there that threw aFormatException error due to some conversion I was doing. I commented out the conversion and the windows service still just began to start up and then stopped automatically.

Further research indicated to me that I might need a loop to keep the processing within the method, so I took information from C — Windows Service the service on and set up an infinite while loop. I also found that there might be Garbage Collection going on and established a KeepAlive statement for the timers as suggested in Examples section of MSDN Timer Class. Still the same issues.

At this point I feel I’ve exhaused all the research I can do so it would be appropriate to post my question here. All my code is below and I will note that before I performed any change I uninstalled the Windows Service, removed the Setup Project, and deleted the installers from the C# code. I then made changes and started back over with the instructions in the Walkthrough starting at the point where it instructs how to setup the installers. I did this each time because I found that if I made changes and did not uninstall the Windows Service, remove the Setup Project, and delete the installers, then my changes would not take effect on the currently installed windows service.

Any assistance you can give would be most appreciated. I will be here for another 15min and then I will check this first thing tomorrow.

Оцените статью