SYMPTOMS
The Service Control Manager (SCM) can be used to stop, start, and pause any service in Microsoft Windows NT, using the command line syntax. Under Win9x, the utility can be used to control SQL Server-related MSSQLServer, SQLServerAgent, and Microsoft Distributed Transaction Coordinator (MSDTC). SCM.exe can be executed from command line with the following arguments:
Service Control Manager Utility Command Line Arguments
=======================================================
-Action
1 = Start, 2 = Restart,
3 = IsRunning (returns exit code of 1056 if an instance of the service is already running.,1062 if the service has not been started.)
4 = Delete Service, 5 = Install Service,
6 = Stop, 7 = Modify
-Server <Optional name of the SQL server (default is this computer)>
-Pwd <Optional SQL server 'sa' password (default is "")>
-StartupOptions <Optional space-delimited list of server startup options>
-Service <Name of the service (default is MSSQLServer)>
-ExePath <Path to the service exe on this computer>
-SvcStartType <1 for SERVICE_DEMAND_START or 2 for SERVICE_AUTO_START>
-SvcAccount <service account name>
-SvcPwd <service account name password>
-Dependencies <List of service name dependencies separated by semi-colons>
-Silent <1 to suppress most messages or 0 for interactive mode>
To start the SQL Server service, use:
scm -Action 1 -Server jtknt0 -Service MSSQLServer
To stop the Microsoft Search service, use:
scm -Action 6 -Server jtknt0 -Service mssearch
Use the options listed in the "Symptoms" section for executing Scm.exe from a command prompt or a batch program.