Archive for December, 2010

11/12/2010

A batchfile to check the status of Windows services and start them automatically if they have stopped

I deal with several applications on a day to day basis, and I was having problems with one in particular it’s associated windows services stopping for no tangible reason.

I therefore devised a batchfile to check the status of each of the services in turn, and start them if they stopped.

@echo off
:start
@ping 127.0.0.1 -n 60 -w 1000 > nul
@echo Checking if Control Manager is running @for /f "tokens=3" %%a in ('sc query "KmpCM"^|find "STATE"') do (
@if %%a==4 goto runningCM
@goto stoppedCM
)
:stoppedCM
net start KmpCM
:runningCM
@echo OK.
@echo.
@ping 127.0.0.1 -n 60 -w 1000 > nul
@echo Checking if Extension Manager is running @for /f "tokens=3" %%a in ('sc query "KmpEM"^|find "STATE"') do (
@if %%a==4 goto runningEM
@goto stoppedEM
)
:stoppedEM
net start KmpEM
:runningEM
@echo OK.
@echo.
@ping 127.0.0.1 -n 60 -w 1000 > nul
@echo Checking if Message Server is running @for /f "tokens=3" %%a in ('sc query "KmpMS"^|find "STATE"') do (
@if %%a==4 goto runningMS
@goto stoppedMS
)
:stoppedMS
net start KmpMS
:runningMS
@echo OK.
@echo.
@ping 127.0.0.1 -n 60 -w 1000 > nul
@echo Checking if Offline Manager is running @for /f "tokens=3" %%a in ('sc query "KmpOM"^|find "STATE"') do (
@if %%a==4 goto runningOM
@goto stoppedOM
)
:stoppedOM
net start KmpOM
:runningOM
@echo OK.
@echo.
@ping 127.0.0.1 -n 60 -w 1000 > nul
@echo Checking if Permission Manager is running @for /f "tokens=3" %%a in ('sc query "KmpPM"^|find "STATE"') do (
@if %%a==4 goto runningPM
@goto stoppedPM
)
:stoppedPM
net start KmpPM
:runningPM
@echo OK.
@echo.
@ping 127.0.0.1 -n 60 -w 1000 > nul
@echo Checking if Scheduler is running
@for /f "tokens=3" %%a in ('sc query "KmpSH"^|find "STATE"') do (
@if %%a==4 goto runningSH
@goto stoppedSH
)
:stoppedSH
net start KmpSH
:runningSH
@echo OK.
@echo.
@ping 127.0.0.1 -n 60 -w 1000 > nul
@echo Checking if Service Manager is running @for /f "tokens=3" %%a in ('sc query "KmpSM"^|find "STATE"') do (
@if %%a==4 goto runningSM
@goto stoppedSM
)
:stoppedSM
net start KmpSM
:runningSM
@echo OK.
@echo.
@goto start

Advertisements
06/12/2010

New look Chocolate Hedgehog website

Haven’t posted for a few days because I’ve been busy developing a new look for the website.

I’ve tried to give it a more striking and memorable appearance using some jQuery and CSS elements.

http://www.chocolatehedgehog.co.uk

01/12/2010

Scrolling div using jQuery

I’m in the process of redesigning the chocolatehedgehog.co.uk website to make it a bit more quirky and interesting.

I found some cool effects in that can be done with jQquery – particularly getting a html div object to follow your progress down the page. http://www.wduffy.co.uk/blog/keep-element-in-view-while-scrolling-using-jquery/ is the tutorial I used, and very good it was too.

http://www.chocolatehedgehog.co.uk/new – the url of my work on this so far. It will become the theme for my main site as soon as the content is ready. I’ll keep you posted.