Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Windows (http://www.go4expert.com/forums/windows-forum/)
-   -   Controlling Windows Services via Batch Script (http://www.go4expert.com/forums/controlling-windows-services-via-batch-t15252/)

gpicazo 26Nov2008 01:23

Controlling Windows Services via Batch Script
 
Hi everyone,

I am trying to write a batch script for the following deployment scenario:

I have a list of services (about 10 of them) that run on a remote server (target for deployment). Before deploying any files to the server, I want to stop any of those 10 services if they are running. Then I can copy/override whatever files I need to for the deployment. Once the deployment is complete, I need to restart ONLY those services that were running prior to the deployment.

I know to use the 'sc' command to stop and start the services, I just don't know how to keep track of which services need to be restarted.

Any help would be greatly appreciated. A sample that depicts a possible solution would be even better.

Thank you,
Genaro

pradeep 26Nov2008 13:12

Re: Controlling Windows Services via Batch Script
 
http://windowsxp.mvps.org/listproc.htm


All times are GMT +5.5. The time now is 05:09.