Re: Writing a script to stop and start a service
From: Chris Puckett [MSFT] (cpuckett_at_online.microsoft.com)
Date: 12/16/04
- Next message: Alan Drown: "Re: how do I change the user install wizard to create user folder in different location?"
- Previous message: kinell: "Re: URGENT :( No external emails received !"
- In reply to: Les Connor [SBS Community Member]: "Re: Writing a script to stop and start a service"
- Next in thread: Allen M: "Re: Writing a script to stop and start a service"
- Reply: Allen M: "Re: Writing a script to stop and start a service"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 16 Dec 2004 23:18:35 GMT
The commands to stop and start a service are 'net stop <servicename>' and '
net start <servicename>'.
You get <servicename> from what is specified in the registry under
HKLM\System\CurrentControlSet\Services. You could also use the Display
Name as listed in the Services Tool, but you have to put it in quotes.
For example, to stop and start the SQL Sharepoint service, you would use:
net stop mssql$sharepoint
net start mssql$sharepoint
Its servicename in the registry and its display name are the same, so let
me give you another example using smtp.
In the registry it is listed as smtpsvc. In the Services Tool it is listed
as "Simple Mail Transport Protocol (SMTP)". This is the Display Name.
'net stop "Simple Mail Transport Protocol (SMTP)"' and 'net stop smtpsvc'
would both stop the smtp service.
Chris Puckett, MCSE
Microsoft Small Business Server Support
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
- Next message: Alan Drown: "Re: how do I change the user install wizard to create user folder in different location?"
- Previous message: kinell: "Re: URGENT :( No external emails received !"
- In reply to: Les Connor [SBS Community Member]: "Re: Writing a script to stop and start a service"
- Next in thread: Allen M: "Re: Writing a script to stop and start a service"
- Reply: Allen M: "Re: Writing a script to stop and start a service"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|