Trying to run script to enable and restart service

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to run a .bat file which will automatically re-enable a disabled
Windows spooler service and then restart the service. I've got the following
script ready

sc config spooler start= auto
net start spooler

When the Windows spooler service changes to disabled, i tried putting this
script under the recovery option in the services console - (when service
fails, run this script), but it does not run... i've tried running the bat
file manually and the service is correctly restarted, etc, i just need to
find out how to get it to run automatically when the service sets itself to
disabled.
 
AJ said:
I'm trying to run a .bat file which will automatically re-enable a disabled
Windows spooler service and then restart the service. I've got the following
script ready

sc config spooler start= auto
net start spooler

When the Windows spooler service changes to disabled, i tried putting this
script under the recovery option in the services console - (when service
fails, run this script), but it does not run... i've tried running the bat
file manually and the service is correctly restarted, etc, i just need to
find out how to get it to run automatically when the service sets itself to
disabled.

I think you have the wrong idea. A disabled service is not the
same as a failed service, hence your script will never be triggered!

What makes you think that the service sets itself to "disabled"?
 
The service is started and runs with no problems and then for some reason it
just stops and sets itself to disabled after a few hours. When you manually
go back in and set back to auto and restart it, there are no problems. There
also does not seem to be a problem with restarting the service, i do not get
any error messages.
 
The service is started and runs with no problems and then for some reason it
just stops and sets itself to disabled after a few hours. When you manually
go back in and set back to auto and restart it, there are no problems. There
also does not seem to be a problem with restarting the service, i do not get
any error messages.






- Show quoted text -

Did you check the system log files? This might show any errors or
other issues that could be causing the service to stop.
 
Checked system log for errors - just advises 'the service entered the stopped
state at time" - nothing else that could help.....i also notice it is
numerous services which seem to be entering the stopped and disabled state,
such as smtp, task scheduler, etc. Would applying the latest service pack
help?
 
Back
Top