Re: how to use vbscript from ole control? by gg
gg
Fri Apr 29 21:24:25 CDT 2005
I finaly stubled across the downlaod for scritp control and got the help
file. that did help me our
I did proof of concept for usign the scirpt control directely from vbscript.
I guess I can use the same approach on the third party programming language:
here is sample code
Dim objVbscript
set objVbscript = CreateObject("MSScriptControl.ScriptControl")
objVbscript.Language = "VBScript"
' objVbscript.Reset()
strCode = "sub Main1()" &vbcrlf &_
"strExeName = ""20050415-009-i32.exe"" " &vbcrlf &_
" VirusDefs_DirName = left( strExeName, 8) + ""."" +
mid(strExeName,10,3)" &vbcrlf &_
" msgbox ""dir="" &VirusDefs_DirName " &vbcrlf &_
" " &vbcrlf &_
"End Sub"
' ***** don't use wscirpt.echo inside the strCode
' ***** - it will demand object and somehow does not recognize wscript
either insdie sub or within scirptcontrol
MSGBOX " msgbox ""dir="" &VirusDefs_DirName " &vbcrlf &_
" "
' wscript.echo strCode
objVbscript.addCode(strCode)
objVbscript.run( "Main1")
"gg" <gg@nomail.nil> wrote in message
news:ez7g9wQTFHA.3184@TK2MSFTNGP15.phx.gbl...
>I am programming on a third party language that does not have some of the
>built-in functionality (regexp) I need from vbscript
>
> I ran into trouble in setting eh language displID for the WSScript.Control
>
> Can some one show me? I try Google but no luck so far, the script56.chm
> did not help me either. I was not using the right search term
>