REXX Script
Hi, Guys.
Is anyone here knows how to create a Rexx script that will detect a service and if it is detected the installation will not continue.
I have here a VB Script, but its not working in Radia. what I need is a Rexx Script.
Below is my VB Script, does anybody know how to convert this to Rexx script if it is convertible?
Thanks!
******************************************************************************************************************************************************************8
On error resume next
Dim objWMI, serviceList, colServiceList
Set WshShell = CreateObject("Wscript.Shell")
Set objWMI = GetObject("winmgmts:root\cimv2")
isService = "True"
Set colServiceList = objWMI.ExecQuery ("Select * from Win32_Service Where Name = 'M86_AUTH'")
if colServiceList.Count >= 1 Then
isService = "False"
msgbox "Service is Installed, Installtion will stop!"
else
isService = "True"
End if
if (isService) Then
'##########################################################################
'## Install Application
'##########################################################################
MsgBox "Service is not Installed, Installtion will continue", 48,"Service"
strCommand = "msiexec /i" & scriptDir & "Authenticator-Service.msi TRANSFORMS=MicrosoftM86SecurityAuthenticator-3.0.5217.0.Mst /qn"
Log "running: " & strCommand
Return = WshShell.Run(strCommand, 1, True)
Log "command return code " & Return
If Return <> 0 and Return <> 3010 Then
Log "return code not 0 or 3010, not good, failed"
Wscript.Quit(Return)
End If
end if
Wscript.quit
4 Comments
[ + ] Show comments
Answers (0)
Please log in to answer
Be the first to answer this question
And again, add logging to your script to determine *why* it's not working. - anonymous_9363 9 years ago
On error resume next
Dim objWMI, serviceList, colServiceList
Set WshShell = CreateObject("Wscript.Shell")
Set objWMI = GetObject("winmgmts:root\cimv2")
isService = "True"
Set colServiceList = objWMI.ExecQuery ("Select * from Win32_Service Where Name = 'M86_AUTH'")
if colServiceList.Count >= 1 Then
isService = "False"
msgbox "Service is Installed, Installtion will stop!"
else
isService = "True"
End if
if (isService) Then
'##########################################################################
'## Install Application
'##########################################################################
MsgBox "Service is not Installed, Installtion will continue", 48,"Service"
strCommand = "msiexec /i" & scriptDir & "Authenticator-Service.msi TRANSFORMS=MicrosoftM86SecurityAuthenticator-3.0.5217.0.Mst /qn"
Log "running: " & strCommand
Return = WshShell.Run(strCommand, 1, True)
Log "command return code " & Return
If Return <> 0 and Return <> 3010 Then
Log "return code not 0 or 3010, not good, failed"
Wscript.Quit(Return)
End If
end if
Wscript.quit - jhe 9 years ago