Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shutdown a Windows Server 2003 Service 2

Status
Not open for further replies.

mjk9564

Programmer
Joined
Apr 23, 2003
Messages
64
Location
US
There are couple services on one of my servers that I'm required to shutdown frequently I am wanting to automate this. Is there a way that I can shutdown a service that is running through code?

Thanks!
Matt
 
Just shell a batch file that contains the "NET STOP" commands to stop the services.

For example:

NET STOP ALERTER
NET STOP "INDEXING SERVICE"

(Note: service names that have a space must be enclosed in quotation marks.)

Or, just create a batch file and run it directly by double-clicking. You can also make a corresponding "NET START" batch file to restart the services:

NET START ALERTER
NET START "INDEXING SERVICE"


I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top