vbscript test reply 9009

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
johnm
Posts: 117
Joined: Fri Apr 01, 2005 9:49 pm

vbscript test reply 9009

Post by johnm »

Hi,

have a very simple VBScript which runs from HM as "External Test".

This is the script. I want it to return as errorlevel the value of intValue.

I tested it from DOS, and it works perfect. When I run it in HM, the reply shows as 9009.

Am I doing something wrong?

{vbscript}
Option Explicit

Dim intValue

' Check that all arguments required have been passed.
If Wscript.Arguments.Count < 1 Then
'Wscript.Echo "Arguments <Host> required. For example:" & vbCrLf _
'& "cscript vbping.vbs savdaldc01"
Wscript.Quit(99)
End If

intValue = Wscript.Arguments(0)
intValue = intValue * 100
Wscript.Echo intValue

Wscript.Quit(intValue)
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

We cannot reproduce this error code on our system.
This is exit code, returned by cscript.exe.
I would recommend you to use Shell Script test instead.
Your script for Shell Script test will look like the following:

Code: Select all

Option Explicit

const statusUnknown     = "scriptRes:Unknown:"
const statusOk          = "scriptRes:Ok:"
const statusBad         = "scriptRes:Bad:"

Dim intValue 

If WScript.Arguments.Count < 1 Then 
 WScript.StdOut.Write statusUnknown&"Arguments <Host> required. For example:"  & "cscript vbping.vbs savdaldc01" 
 Wscript.Quit 
End If 

intValue = Wscript.Arguments(0) 
intValue = intValue * 100 
WScript.StdOut.Write statusOk&intValue
Start CMD: cmd /c cscript /B /E:VBScript %Script% %Params%
johnm
Posts: 117
Joined: Fri Apr 01, 2005 9:49 pm

Post by johnm »

thank you. it worked with a little more tweaking for my needs.
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

You are welcome.
Post Reply