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)
vbscript test reply 9009
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
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:
Start CMD: cmd /c cscript /B /E:VBScript %Script% %Params%
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
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact: