Groups | Blog | Home
all groups > sql server (microsoft) > december 2006 >

sql server (microsoft) : SCM (Service Control Manager) output...


Blue Streak
12/29/2006 8:16:47 AM
Okay, I'm confused.

I am working with MSDE 1.0 (v 7.00) and MSDE 2000 (v 8.00) and the SCM
utility. When I run the command "scm" I get a help screen with many of
the different options available. For instance, if I were to type the
command "scm -action 3" it will return an exit code to indicate if the
MS-SQL server is running or not, "1" for TRUE and "-1" for FALSE.

I ran the following VBScript:
Set oShell = CreateObject("WScript.Shell")

If (oShell.Environment("PROCESS")("OS") = "Windows_NT") Then
Set oProg = oShell.Exec("scm -action 3 -service mssqlserver -silent
1")
Else
Set oProg = oShell.Exec("scm -action 3 -silent 1")
End If


Do While oProg.Status = 0
WScript.Sleep 100
Loop

WScript.Echo "Return code was: " & oProg.ExitCode

I get the exit code "1056" when the service is paused or running.
I get "1062" when it is stopped.

Hunh!?!
Last time I checked 1062 is not equal to -1 and 1056 is not 1.
What gives?

Is this because I am running WinXP-SP2 instead of Win9x?
Blue Streak
1/1/2007 9:03:33 PM

[quoted text, click to view]

To answer my own question:

1056 / 1062 are from NT-based O/S
-1 / 1 are from 9x-based O/S
AddThis Social Bookmark Button