Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Returns a value that indicates whether a particular service is running.
retVal = IShellDispatch2.IsServiceRunning(
sServiceName
)
IShellDispatch2.IsServiceRunning( _
ByVal sServiceName As BSTR _
) As Variant
-
sServiceName [in]
-
Type: BSTR
A String that contains the name of the service.
Type: Variant*
Returns true if the service specified by sServiceName is running; otherwise, false.
Type: Variant*
Returns true if the service specified by sServiceName is running; otherwise, false.
This method is implemented and accessed through the Shell.IsServiceRunning method.
This method is not currently available in Microsoft Visual Basic.
The following examples show the use of IsServiceRunning to determine whether the Themes service is running for an application. Usage is shown for JScript and VBScript.
JScript:
<script language="JScript">
function fnIsServiceRunningJ()
{
var objShell = new ActiveXObject("shell.application");
var bReturn;
bReturn = objShell.IsServiceRunning("Themes");
}
</script>
VBScript:
<script language="VBScript">
function fnIsServiceRunningVB()
dim objShell
dim bReturn
set objShell = CreateObject("shell.application")
bReturn = objShell.IsServiceRunning("Themes")
set objShell = nothing
end function
</script>
Requirement | Value |
---|---|
Minimum supported client |
Windows 2000 Professional, Windows XP [desktop apps only] |
Minimum supported server |
Windows Server 2003 [desktop apps only] |
Header |
|
IDL |
|
DLL |
|