$pathOfWFBSHInstaller="msiexec /qn /i \\SERVER\netlogon\Kix32\Apps\TrendMicro\Agent_Installer.msi"
$strComputer = "."
$strOutput = ""
$serviceCount = 0
$totalServiceCountToCheck = 3
; check if WFBS-SVR is installed by detecting service ntrtscan, tmlisten, svcGenericHost are exist or not
$objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" + $strComputer + "\root\cimv2")
$colItems = $objWMIService.ExecQuery("Select * from Win32_Service")
For Each $objService in $colItems
$strOutput = $strOutput + $objService.name + @CRLF
Select
Case $objService.name = "ntrtscan"
$serviceCount = $serviceCount + 1
;? "Service " + $objService.Caption + " is " + $objService.Started
Case $objService.name = "tmlisten"
$serviceCount = $serviceCount + 1
;? "Service " + $objService.Caption + " is " + $objService.Started
Case $objService.name = "svcGenericHost"
$serviceCount = $serviceCount + 1
;? "Service " + $objService.Caption + " is " + $objService.Started
EndSelect
Next
If $serviceCount <> $totalServiceCountToCheck
Dim $WshShell
$WshShell = CreateObject("WScript.Shell")
$WshShell.Run($pathOfWFBSHInstaller)
EndIf