I have a vbscript that I need to call from within a form.
This vbscript calls data from a custom database table and I need it to populate a multipline edit field.
Error I get is Network Path was not found. If I run it under a doss windows, I get the desired results.
Any help will be greatly appreciated.
Function currently is as follows:
fn GetICD9()
{
local Progname = "\\servername\clinkits\SelectCode\ICD9Codes.vbs"
local argStr = DOCUMENT.TEST_EDIT
RUNSHELLOPEN(Progname, argStr)
}
if servername is a shared drive, try it with the actual drive name instead of the shared name.
Script is currently hosted on our jboss server on the same share we use for the clinic kits and files for jobs.txt.
It is shared to everyone read/execute.
When I run it using runtextprocess it apears to work, but I get an error about bad option of /o.
Also tried with progname=cscript.exe and the path in the argstr.
You might try changing whacks to slashes - i've seen problems with that before as they may be interpreted as escapes, though not sure if that will resolve this here.
I've had success calling vbscripts in the following way:
{
local application = "wscript.exe"
local args = "//centricitylinks/scripts/ClearDataFiles.vbs"
runshellopen(application, args)
}
Call wscript.exe and pass the name of the script as an argument to wscript.exe. I also use forward slashes to delineate directories and filenames.
Hope this helps.
Got it working....Sort of....
It runs, I see the DOS window apear and flash containing the results of the vb script.
I need to have the output of the script populate a variable. Not just a true of false.
Current code as follows:
fn GetICD9()
{
local Progname = "cscript.exe"
code = DOCUMENT.TEST_EDIT
local argStr = "\srovp0021\clinkits\SelectCode\ICD9Codes.vbs " + code
RUNSHELLOPEN(Progname, argStr) > DOCUMENT.TEST4
}
In that case, you will need to have the vbscript write the result to a separate file that MEL will open and read the contents. I found that I had to make the MEL code "wait" for the vbscript to finish writing to the file by looping until there was data to read from the file.
The other alternative is you will need to develop a custom executable that is called by the runtextprocess function that can handle the /o switch that MEL tacks on to tell the application which temporary file to write the results to.
I just upgraded my test system to 11.0. The problem with the /o is no longer present.
Script runs fine now, but how can I capture the results from the vbs into a variable in a form?