 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
klwong
Joined: 07 Mar 2009 Posts: 22 Country: Australia |
|
Passing parameters between JAL and VBS |
|
Do anybody know if it is possible to pass parameters between JAL and VBS ?
|
|
Wed Jul 01, 2009 5:52 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7949
|
|
|
|
Do you mean passing parameters when invoking VBS code from JAL code or passing parameters between jobs of different types?
In the first case, the script is executed dynamically as a text. You can build it anything you want and concatenate parameter values as needed. In the second case you can save values to INI files, other text files, database, etc.. and read it from another job.
If you need more help, please post specific example and describe where you got stuck.
|
|
Wed Jul 01, 2009 8:59 am |
|
 |
klwong
Joined: 07 Mar 2009 Posts: 22 Country: Australia |
|
|
|
Yes, would like to pass parameter to VBS via JAL. Basically I would like to pass a parameter called 'username' to the vbs, then capture the return 'value' from vbs.
JAL code
DIM (global.value,string)
DIM (global.username,string)
SET (global.username,"KLWONG")
VBScriptexecute "C:\KLTEST.VBS"
Messagebox (global.value)
VBS code (file C:\KLTEST.VBS)
Sub main()
If username = "KLWONG" Then value = "TRUE"
End Sub
Try to run and the JAL job disabled. I suspect is the way I pass the parameter and appreciate any help.
|
|
Thu Jul 02, 2009 5:47 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7949
|
|
|
|
VBScriptExecute statement requires the actual code to be executed, not a file name of an external VBScript file. The code is executed internally by VBScript engine running within 24x7 instance.
Forr example
 |
 |
Dim vb, string
ContactEx( "Sub Main()\r\nIf \"", username, "\" = "KWONG" Then\r\n", ...and so on..., vb )
VBSCriptExecute( vb ) |
Note that concatenation of username parameter.
Now, how about using ProcessKill statement in JAL instead of all this mess? Or using KillProcess utility http://www.softtreetech.com/24x7/archive/49.htm which can be invoked using Run or RunAndWait?
|
|
Thu Jul 02, 2009 8:10 am |
|
 |
klwong
Joined: 07 Mar 2009 Posts: 22 Country: Australia |
|
|
|
I see, thanks for the clarification.
By the way you also mentioned about the 'ProcessKill' in your respond. Do I need to use this under the scenario ? Just in case I missed something.
|
|
Thu Jul 02, 2009 8:18 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7949
|
|
|
|
Sorry, I don't get your question. In which schenario?
|
|
Thu Jul 02, 2009 8:23 am |
|
 |
klwong
Joined: 07 Mar 2009 Posts: 22 Country: Australia |
|
|
|
Your reply say
"Now, how about using ProcessKill statement in JAL instead of all this mess? Or using KillProcess utility http://www.softtreetech.com/24x7/archive/49.htm which can be invoked using Run or RunAndWait?"
I was wondering what this is for ??
|
|
Thu Jul 02, 2009 8:35 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7949
|
|
|
|
Sorry, I misread your initial question. I read KLTEST.VBS as KILLTEST.VBS. Killing processes is a common question on this board. Please disregard the ProcessKill reference.
|
|
Thu Jul 02, 2009 8:49 am |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|