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?
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
Thanks! I am new to VB.NET and was looking to do it through code, but this will get them by. I did find out how to do it in VB.NET. WOW the code in VB 6 I use to use was huge compared to this.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.