>I am trying to run a Windows script from VFP, and it works fine, except I can't seem to get the script to use the parameter I pass it. I haven't used the scripting engoine before, but the syntax seems to be:
>
>run /n4 wscript.exe myscript.vbs
>
>I tried adding a parameter as:
>
>run /n4 wscript.exe myscript.vbs "c:\mypath"
>
>The script runs without error, but the path isn't used. I did DIM a variable in the script, but can't see anyway to identify the varible with an incoming parameter.
>
>What I want to do is send a path to he script by way of a variable. The sample code uses the %winddir% example, but "windir" is a known location. I need to send the path to my APP. Can this be done, and if so how?
>
>Thanks,
Steve,
Yes, it can be done. You need to use the WScript.Arguments collection. For example,
Dim cPath, args
Set args = WScript.Arguments
cPath = args(0)
Just one question, why not use the WScript.Shell object to run the script file? That way you only have to pass the fully qualified name of the script file. You can optionally pass the window and and make the caller wait for the script to complete.
George
Ubi caritas et amor, deus ibi est