DADITWebGroup
asked on
What is the best method of utilizing a batch file to kill Windows 2003 Server services in T-SQL???
I need to generate a batch file that will interactively disable a specific group of services within a SQL job. These services have to be disabled one at a time and in sequence so that one service has been verified to be disabled before the next one can be disabled. The batch file to kill services in general is pretty basic (I know), but what I would like to know is if anyone has experience building something a little more dynamic with some type of loop that verifies that the present service being disabled has in fact been positvely disabled before the batch moves to the next item. All these services have to be disabled in order for me to be able to run the proper maintenance required for the databases. Any ideas?
ASKER
This looks great, however I will give you an example of how I am trying to use it and the error I receive. What am I dong wrong? I tried using a local file path and this example represents the network path. I am stopping the sql agent just for testing purposes.
Stop-srv.JPG
Stop-srv.JPG
In "set svcs=" you need to put the actual name of the service, putting in the network location will not work.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window