Dear VBS Experts,

I'm trying to do something that I'm not sure is possible, so any
experienced input would be helpful. Basically, I have a web app that is
designed to accept user input. Based on the input, several variables are
sent to a central coordinating function (the vbs code will either be on the
ASP page itself, but more likely part of a COM+ object). One of the
variables that will be passed to this coordinating function is a number that
represents a certain piece of code that needs to be run against the remaining
variables. However, I want the code to reside in seperate .vbs files that
are not part of the application. The central function reads an .ini sub task
file that will show (based on the number in the first variable) the path to
the .vbs file to run when processing the input.

It probably sounds a little crazy already, but my purpose in this special
case is so that I can keep the actual source code (for a growing and dynamic
list of functions that I call sub-tasks), completely seperate from the ASP
application and any COM+ registered modules. My delimma is to find a way to
effectively call the individual .vbs files, run them against the variables
that were passed to the coordinating function in the ASP page, and return any
results from these .vbs files to the ASP application.

So far, I don't know of any way that I can use a returned result from a
function (such as the path to the .vbs file returned from the sub task .ini
file) to run another function by name, even if it was a registered COM+
object. So it seems that my only alternative is to call the .vbs files and
run them against the variables using the shell command. In doing so, is
there any way that I can return any error codes generated by the various .vbs
files that run? For example, if I shell the variables to a CreateADGroup.vbs
file from the coordinating function, is it able to return Active Directory
specific error codes or will it only return general error codes related to
the shell?

Any other ideas in ways of running, what you might call "off-line code",
from a sentral code function would be helpful. My only requirment is that
the actual task specific code be located in seperate .vbs files that do not
require them to be registered in COM+ modules. In some respects, running
these sub tasks in seperate threads has some advantages in terms of
distributed processing etc.

If anyone has some thought on how I can accomplish this, I'm all ears.

Rpz

Re: Using a Variable To Run A Function by Anthony

Anthony
Tue Oct 10 09:17:19 CDT 2006


"ISTech" <ISTech@discussions.microsoft.com> wrote in message
news:6DF226DC-446B-43C4-A424-5BF527220302@microsoft.com...
> Dear VBS Experts,
>
> I'm trying to do something that I'm not sure is possible, so any
> experienced input would be helpful. Basically, I have a web app that is
> designed to accept user input. Based on the input, several variables are
> sent to a central coordinating function (the vbs code will either be on
the
> ASP page itself, but more likely part of a COM+ object). One of the
> variables that will be passed to this coordinating function is a number
that
> represents a certain piece of code that needs to be run against the
remaining
> variables. However, I want the code to reside in seperate .vbs files that
> are not part of the application. The central function reads an .ini sub
task
> file that will show (based on the number in the first variable) the path
to
> the .vbs file to run when processing the input.
>
> It probably sounds a little crazy already, but my purpose in this
special
> case is so that I can keep the actual source code (for a growing and
dynamic
> list of functions that I call sub-tasks), completely seperate from the ASP
> application and any COM+ registered modules. My delimma is to find a way
to
> effectively call the individual .vbs files, run them against the variables
> that were passed to the coordinating function in the ASP page, and return
any
> results from these .vbs files to the ASP application.
>
> So far, I don't know of any way that I can use a returned result from a
> function (such as the path to the .vbs file returned from the sub task
.ini
> file) to run another function by name, even if it was a registered COM+
> object. So it seems that my only alternative is to call the .vbs files
and
> run them against the variables using the shell command. In doing so, is
> there any way that I can return any error codes generated by the various
.vbs
> files that run? For example, if I shell the variables to a
CreateADGroup.vbs
> file from the coordinating function, is it able to return Active Directory
> specific error codes or will it only return general error codes related to
> the shell?
>
> Any other ideas in ways of running, what you might call "off-line
code",
> from a sentral code function would be helpful. My only requirment is that
> the actual task specific code be located in seperate .vbs files that do
not
> require them to be registered in COM+ modules. In some respects, running
> these sub tasks in seperate threads has some advantages in terms of
> distributed processing etc.
>
> If anyone has some thought on how I can accomplish this, I'm all ears.
>
> Rpz

Don't use .vbs use .asp. In your central ASP page lookup the path of the
ASP needed to perform a specific function then use
Server.Transfer/Server.Execute to execute the file.