June 23, 2010

WinTask - isServiceInstalled()



'
' isServiceInstalled - determines if a Windows Service is installed or not
'
' Author: Joe Strazzere
'
' see: http://msdn.microsoft.com/en-us/library/ms681383(VS.85).aspx

Function isServiceInstalled(Service$)
If isServiceStarted(Service$) = 1060 Then
isServiceInstalled = 0
Else
isServiceInstalled = 1
EndIf
EndFunction

MsgBox(isServiceInstalled("WTScheduler"))
MsgBox(isServiceInstalled("DoesNotExist"))


My name is Joe Strazzere and I'm currently a Director of Quality Assurance.
I like to lead, to test, and occasionally to write about leading and testing.

No comments:

Post a Comment