Trying to run script to enable and restart service


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.
 
Ad

Advertisements

P

Pegasus \(MVP\)

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"?
 
G

Guest

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.
 
B

boeprox

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.
 
Ad

Advertisements

G

Guest

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top