ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

Small program i could run to restart a stubborn service?

(1/4) > >>

Grorgy:
Hi
I'm looking for a little program to restart a service that refuses to do what it is supposed to when i reboot the computer, the service starts but it doesn't actually do what it should till i stop it and restart it  :down:.  At the moment I'm using a couple of bat files to stop it then restart it, this works fine but is beginning to be a bit tiresome, particularly if i forget to do it, so what I am looking for is a program that i could run that would restart a selected service or services and then I could have this set to run at startup.

Does such an animal exist somewhere that anyone knows of?

Thanks
George

Ralf Maximus:
Could you not stick the .bat file itself in your startup? 

Of course you want the batch file to wait awhile before doing its thing, so add a TIMEOUT delay to the beginning to hold for x number of seconds, until your system settles down after booting.

If you don't have TIMEOUT.EXE on your system, it can be had as part of the Server 2003 Resource kit.

Carol Haynes:
The problem with a single batch file is that it is difficult to establish when the service has stopped so that you can restart it.

If you simply have a batch file that says:

SC STOP service
SC START service

the second command will probably fail if the service doesn't respond quickly to the STOP command.

There doesn't seem to be an easy way to establish when the service has actually stopped short of:

SC QUERY service > textfile.txt

and then use a little program to read the value following the STATE and loop until it is set to the stopped value.

For someone who is quick witted with AutoHotKey programming this would probably be a simple task to do.

Ralf Maximus:
Your logic is flawless, your conclusion inescapable.  Normally I would kneel before it's perfection.

However Grorgy says he already has a batch file that works, thus it's reasonable to assume the timing/delay issues have been worked out.

Grorgy:
ahhh nooo ralf, the timing and delay issues at present are all solved in a purely manual way lol.  I watch the first one, then run the second to restart it  ;D  I have 2 bat files,, first 1 stops it,  i then run the second to restart it, and its the manual bits of all this I'm getting sick of  :)   The way im doing it is easier than going to services and a bit easier than using the FARR plugin but its not ideal (of course ideally the service would start ok but it doesn't)

Navigation

[0] Message Index

[#] Next page

Go to full version