As I understand you are talking about WScript.
There is collection of command-line arguments in WScript object (which is
global object there and you don't need to declare it)
Then from your VB application you can call vbs like:
'this is code in VB to call vbs
Dim sComStr As String
'vbs file is just an argument of script engine (wscript.exe)
'you might need to "play" with paths to files
sComStr = "wscript.exe " & "test.vbs " & RBselection 'add argument
according to your radio-button selection
ChDir App.Path 'set current folder to that, where vbs file and
wscript.exe are located (I put them together into vb's project folder for
simplicity)
Shell sComStr 'note Shell command doesn't like paths with spaces - there
are ways around
For testing I've created the following small script (in my case it is
test.vbs)
dim varTest
If WScript.Arguments.Count then varTest=WScript.Arguments(0)
msgbox "Argument " & varTest
As a result, when I call this script with some value of RBselection, then
msgbox with this value is shown
Hope, this is what you need. If you still need to read VB's data from within
vbs, then your VB must be built as ActiveX component and then you can expose
its public interface to vbs via late binding.
Dmitriy,
MCSD.
"D.P. Roberts" <dp*******@pbride.com> wrote in message
news:ud**************@tk2msftngp13.phx.gbl...
I have 3 vbscripts and a vb form with radio buttons corresponding to each
script. The form's only purpose is to provide a nice GUI for the user to
decide which of the 3 scripts to run. Now, because the scripts are mostly
identical to one another, I'd really like to combine them into one script.
But I can't for the life of me figure out how to pass a radio button value
from a vb form to the script so the appropriate portion of the script is
executed based on which radio button was selected. Basically I need the
script to do something like this:
RBselection = <the radio button selected on the vb form>
Select Case RBselection
Case RadioButton1
varSelection = 1
Case RadioButton2
varSelection = 2
Case RadioButton3
varSelection = 3
If I could somehow do this, then I could use the varSelection value to run
the necessary parts of the script. Anyone know if this is possible?
Thanks in advance...