Re: Writing a script to stop and start a service

From: Chris Puckett [MSFT] (cpuckett_at_online.microsoft.com)
Date: 12/16/04


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.
--------------------



Relevant Pages

  • Re: Configuation screen
    ... a particular value in registry and kill this process and boot my main ... process and display them graphically. ... machines, ie the number of sensors can be different on each machine type, the ... use the same set of sensors for each vehicle type. ...
    (microsoft.public.windowsce.embedded)
  • Re: PNG
    ... Red X Instead of Images - Can't see or save Images/Pictures ... "UseHR" registry value is added to the registry. ... These are the steps for changing the DPI setting on your system. ... Right-click the Windows desktop to display the context menu. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: jpg / gif images smeared on IE6-Outlook6
    ... Check the registry associations for the image file types. ... >I posted before on the issue of not seeing graphics properly on the IE 6 ... > Change the DPI setting from Large to Normal and see if that helps. ... > Right-click the Windows desktop to display the context menu. ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: Slowing Record Navigation
    ... If you modify the Registry as Bob mentioned to stop the display of the ... "loading Image" dialog then you will no longer crash as you scroll through ...
    (microsoft.public.access.modulesdaovba)
  • Re: system access violation
    ... display the password input dialog and then the program loads. ... Before the second copy can display the password dialog, ... allowing multiple instances of the application to be run. ... using a boolean in the registry. ...
    (microsoft.public.dotnet.general)