Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Can somebody give me a script advice/example of how to restart services?

I have to restart 17 services, but the first 4 services have to be in the right order and after the restart command is given to one of the services, the next one should be started when the previous one is finished.

I know I can restart a service by net command, and I can build a delay by for example a ping command that repeats for an x amount of times, but I never know in advance how long it is going to take for a service to restart.

Thanks, Kindest regards, Marcel

share|improve this question

3 Answers 3

up vote 1 down vote accepted

On our BES we have these scripts

Startup

net start "BlackBerry Router"
net start "BlackBerry Dispatcher"
net start "BlackBerry Controller"
net start "BlackBerry Policy Service"
net start "BlackBerry SyncServer"
net start "BBAttachServer"
net start "BlackBerry MDS Connection Service"
net start "Blackberry Server Alert"
net start "Blackberry Database Consistency Service"
pause

Shutdown

net stop "Blackberry Server Alert"
net stop "BBAttachServer"
net stop "BlackBerry Controller"
net stop "BlackBerry Dispatcher"
net stop "BlackBerry MDS Connection Service"
net stop "BlackBerry Policy Service"
net stop "BlackBerry Router"
net stop "BlackBerry SyncServer"
net stop "Blackberry Database Consistency Service"
pause
share|improve this answer
    
thank you Jamespo –  ICTdesk.net Feb 17 '10 at 15:33

make it scripted and ensure this runs everyday at early mornings.

share|improve this answer

If you put the net stop commands in a batch file in the order that the services need to be stopped and started they will be processed one after another. The first service will stop, then the second, etc. The second and subsequent services (net stop commands) won't be processed until the previous one completes.

share|improve this answer
    
Thank you for your quick answer! –  ICTdesk.net Feb 17 '10 at 13:33
    
Glad to help... –  joeqwerty Feb 17 '10 at 14:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.