|
it
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Script to restart serviceOne of our services seems to be freezing almost daily. We will be upgrading
the server in a few weeks which should take care of the problem but until then I was wondering if there is a way to setup a script that would automatically restart the service whenever it stops. Were using NT4. Thanks. Marco:
Here is a sample. Modify as needed: http://cwashington.netreach.net/depo/view.asp?Index=539&ScriptType=command -Allen Firouz Show quoteHide quote "Marco" wrote: > One of our services seems to be freezing almost daily. We will be upgrading > the server in a few weeks which should take care of the problem but until > then I was wondering if there is a way to setup a script that would > automatically restart the service whenever it stops. Were using NT4. > Thanks. > > > Thanks
Show quoteHide quote "Allen Firouz" <AllenFir***@discussions.microsoft.com> wrote in message news:41B52F39-96BC-46B7-9E92-739B6A3C1201@microsoft.com... > Marco: > > Here is a sample. Modify as needed: > http://cwashington.netreach.net/depo/view.asp?Index=539&ScriptType=command > > -Allen Firouz > > "Marco" wrote: > >> One of our services seems to be freezing almost daily. We will be >> upgrading >> the server in a few weeks which should take care of the problem but until >> then I was wondering if there is a way to setup a script that would >> automatically restart the service whenever it stops. Were using NT4. >> Thanks. >> >> >> On Mon, 4 Apr 2005 09:04:51 -0400, "Marco" <nospampleasesyxxpk@hotmail.com> wrote: You can start a batch from the AT service:>One of our services seems to be freezing almost daily. We will be upgrading >the server in a few weeks which should take care of the problem but until >then I was wondering if there is a way to setup a script that would >automatically restart the service whenever it stops. Were using NT4. >Thanks. > at HH:MM "C:\Folder\batch.bat" where HH:MM is 2 minutes in the future. Assuming the service display name is "my service", batch.bat could contain: @echo off setlocal :loop @ping -n 61 127.0.0.1>nulset OK=N for /f "Tokens=*" %%a in ('net start^|FIND /I "my service"') do ( set OK=Y ) if "%OK%" EQU "Y" goto loop net start "my service" goto loop Jerold Schulman Windows Server MVP JSI, Inc. http://www.jsiinc.com
Other interesting topics
|
|||||||||||||||||||||||