Hi,
I would like to write a shell script in vbscript.
In this script I need to use the test name and the test folderpath.
How can I get this parameters in the script?
Thnaks
Csaba
Test propertis in a shell script
Use macro variables: %TestName% and %FullPath%
For details please check the manual, help system or use on-line help
http://www.ks-soft.net/hostmon.eng/mfra ... m#chkShell
http://www.ks-soft.net/hostmon.eng/mfra ... .htm#macro
Quote from the manual
=======================
Params
If script requires some parameters, "Hint" field will show you the list of parameters. E.g. "SYSTEM: Average Load for the past 5 min" script requires single parameter: <alert threshold>. If you specify "50" as the script parameter and script detects that system load is over 50%, it will set "Bad" status for the test. Otherwise status of the test will be "Ok".
Translate macros
With this option enabled you can use global macro variables as script parameters.
=======================
Regards
Alex
For details please check the manual, help system or use on-line help
http://www.ks-soft.net/hostmon.eng/mfra ... m#chkShell
http://www.ks-soft.net/hostmon.eng/mfra ... .htm#macro
Quote from the manual
=======================
Params
If script requires some parameters, "Hint" field will show you the list of parameters. E.g. "SYSTEM: Average Load for the past 5 min" script requires single parameter: <alert threshold>. If you specify "50" as the script parameter and script detects that system load is over 50%, it will set "Bad" status for the test. Otherwise status of the test will be "Ok".
Translate macros
With this option enabled you can use global macro variables as script parameters.
=======================
Regards
Alex
ok I see.
But
I have more then hundred test which use the special VBscript.
I would like to modify this script and want to use the test path parameter in the script.
My question is that how can I get the %FullPath% variable value and give to the vbs variable.
I tried this but this didn't working:
Dim TestFolder
Testfolder=%FullPath%
But
I have more then hundred test which use the special VBscript.
I would like to modify this script and want to use the test path parameter in the script.
My question is that how can I get the %FullPath% variable value and give to the vbs variable.
I tried this but this didn't working:
Dim TestFolder
Testfolder=%FullPath%
Please read my previous answer. I was talking about Params property of the test. It allows you to specify different parameters for the same script.
If you are using VB Script you may use the following command as "Start cmd" parameter:
cmd /c cscript /B /E:VBScript %Script% %Params%
Then you may use parameters in the script
E.g.
dim i, objArgs
Set objArgs = WScript.Arguments
For I = 0 to objArgs.Count - 1
WScript.StdOut.Write objArgs(I)+" "
Next
Regards
Alex
If you are using VB Script you may use the following command as "Start cmd" parameter:
cmd /c cscript /B /E:VBScript %Script% %Params%
Then you may use parameters in the script
E.g.
dim i, objArgs
Set objArgs = WScript.Arguments
For I = 0 to objArgs.Count - 1
WScript.StdOut.Write objArgs(I)+" "
Next
Regards
Alex