From: SeeYouAgainBye on 22 Jul 2006 07:36 Hello, Does anyone know how to call vbe from wsf ? vbe is encoded vbscript file with screnc.exe. I make func.vbs and sample.wfs. sample.wfs code is like below. <Job id="sample1"> <Script Language="VBScript" src="func.vbs"></Script> <Script Language="VBScript"> Dim str str = func("aaa") WScript.Echo(str) </Script> </Job> The sample.wfs works as i expected. But I encode func.vbs to func.vbe, and change sample.wfs line 2 as below. <Script Language="VBScript" src="func.vbe"></Script> Then sample.wfs said error below. sample.wsf(1, 2) Microsoft VBScript compilation error: Expected statement note that screnc.exe was download from below: http://www.microsoft.com/downloads/details.aspx?FamilyID=e7877f67-c447-4873-b1b0-21f0626a6329&DisplayLang=en Regards, seeyouagainbye(a)hotmail.com
From: "Michael Harris (MVP)" mikhar at mvps dot on 22 Jul 2006 16:53 SeeYouAgainBye wrote: > Hello, > Does anyone know how to call vbe from wsf ? > vbe is encoded vbscript file with screnc.exe. > > I make func.vbs and sample.wfs. > sample.wfs code is like below. > > <Job id="sample1"> > <Script Language="VBScript" src="func.vbs"></Script> > <Script Language="VBScript"> > Dim str > str = func("aaa") > WScript.Echo(str) > </Script> > </Job> > > The sample.wfs works as i expected. > But I encode func.vbs to func.vbe, and change sample.wfs line 2 as > below. > > <Script Language="VBScript" src="func.vbe"></Script> <Script Language="VBScript.Encode" src="func.vbe"></Script> > > Then sample.wfs said error below. > > sample.wsf(1, 2) Microsoft VBScript compilation error: Expected > statement > > note that screnc.exe was download from below: > http://www.microsoft.com/downloads/details.aspx?FamilyID=e7877f67-c447-4873-b1b0-21f0626a6329&DisplayLang=en > > Regards, > seeyouagainbye(a)hotmail.com -- Michael Harris Microsoft MVP Scripting
From: SeeYouAgainBye on 23 Jul 2006 03:50 Thank you Michael, but it does not work after changing as you said. The error message is changed to below: sample.wsf(0, 1) Windows Script Host: The parameter is incorrect. I continue to try to fix but currently cannot... The source code as follows: sample.wsf: <job id="sample1"> <script language="VBScript.Encode" src="func.vbe"></script> <script language="VBScript"> Dim str str = func("aaa") WScript.Echo(str) </script> </job> func.vbs: Function func(strInput) func = strInput & " is inputted." End Function (func.vbe is created from func.vbs with screnc.exe.) Any comment or idea? Regards, seeyouagainbye(a)hotmail.com Michael Harris (MVP) wrote: > SeeYouAgainBye wrote: >> Hello, >> Does anyone know how to call vbe from wsf ? >> vbe is encoded vbscript file with screnc.exe. >> >> I make func.vbs and sample.wfs. >> sample.wfs code is like below. >> >> <Job id="sample1"> >> <Script Language="VBScript" src="func.vbs"></Script> >> <Script Language="VBScript"> >> Dim str >> str = func("aaa") >> WScript.Echo(str) >> </Script> >> </Job> >> >> The sample.wfs works as i expected. >> But I encode func.vbs to func.vbe, and change sample.wfs line 2 as >> below. >> >> <Script Language="VBScript" src="func.vbe"></Script> > > <Script Language="VBScript.Encode" src="func.vbe"></Script> > > >> Then sample.wfs said error below. >> >> sample.wsf(1, 2) Microsoft VBScript compilation error: Expected >> statement >> >> note that screnc.exe was download from below: >> http://www.microsoft.com/downloads/details.aspx?FamilyID=e7877f67-c447-4873-b1b0-21f0626a6329&DisplayLang=en >> >> Regards, >> seeyouagainbye(a)hotmail.com >
From: Babu VT on 23 Jul 2006 08:41 Hi, To encode script within a .wsf file, below is the format ,but WITHOUT QUOTES in language value ... <language=VBScript.Encode src="encodedfile.vbe"> rgds Babu "SeeYouAgainBye" <SeeYouAgainBye(a)hotmail.com> wrote in message news:ei282yirGHA.5032(a)TK2MSFTNGP02.phx.gbl... > Thank you Michael, > but it does not work after changing as you said. > The error message is changed to below: > > sample.wsf(0, 1) Windows Script Host: The parameter is incorrect. > > I continue to try to fix but currently cannot... > The source code as follows: > > sample.wsf: > > <job id="sample1"> > <script language="VBScript.Encode" src="func.vbe"></script> > <script language="VBScript"> > Dim str > str = func("aaa") > WScript.Echo(str) > </script> > </job> > > func.vbs: > > Function func(strInput) > func = strInput & " is inputted." > End Function > > (func.vbe is created from func.vbs with screnc.exe.) > > Any comment or idea? > > Regards, > seeyouagainbye(a)hotmail.com > > > Michael Harris (MVP) wrote: >> SeeYouAgainBye wrote: >>> Hello, >>> Does anyone know how to call vbe from wsf ? >>> vbe is encoded vbscript file with screnc.exe. >>> >>> I make func.vbs and sample.wfs. >>> sample.wfs code is like below. >>> >>> <Job id="sample1"> >>> <Script Language="VBScript" src="func.vbs"></Script> >>> <Script Language="VBScript"> >>> Dim str >>> str = func("aaa") >>> WScript.Echo(str) >>> </Script> >>> </Job> >>> >>> The sample.wfs works as i expected. >>> But I encode func.vbs to func.vbe, and change sample.wfs line 2 as >>> below. >>> >>> <Script Language="VBScript" src="func.vbe"></Script> >> >> <Script Language="VBScript.Encode" src="func.vbe"></Script> >> >> >>> Then sample.wfs said error below. >>> >>> sample.wsf(1, 2) Microsoft VBScript compilation error: Expected >>> statement >>> >>> note that screnc.exe was download from below: >>> http://www.microsoft.com/downloads/details.aspx?FamilyID=e7877f67-c447-4873-b1b0-21f0626a6329&DisplayLang=en >>> >>> Regards, >>> seeyouagainbye(a)hotmail.com >>
From: SeeYouAgainBye on 23 Jul 2006 22:54
Thank you Babu, but it returned an error. I changed <script language="VBScript.Encode" src="func.vbe"></script> to <script language=VBScript.Encode src="func.vbe"></script> then the error shown as below. sample.wsf(3, 19) Windows Script Host: Expecting an attribute value enclosed in quotes Any comment or idea? Regards, seeyouagainbye(a)hotmail.com Babu VT wrote: > Hi, > > To encode script within a .wsf file, below is the format ,but WITHOUT QUOTES > in language value ... > > <language=VBScript.Encode src="encodedfile.vbe"> > > rgds > Babu > > "SeeYouAgainBye" <SeeYouAgainBye(a)hotmail.com> wrote in message > news:ei282yirGHA.5032(a)TK2MSFTNGP02.phx.gbl... >> Thank you Michael, >> but it does not work after changing as you said. >> The error message is changed to below: >> >> sample.wsf(0, 1) Windows Script Host: The parameter is incorrect. >> >> I continue to try to fix but currently cannot... >> The source code as follows: >> >> sample.wsf: >> >> <job id="sample1"> >> <script language="VBScript.Encode" src="func.vbe"></script> >> <script language="VBScript"> >> Dim str >> str = func("aaa") >> WScript.Echo(str) >> </script> >> </job> >> >> func.vbs: >> >> Function func(strInput) >> func = strInput & " is inputted." >> End Function >> >> (func.vbe is created from func.vbs with screnc.exe.) >> >> Any comment or idea? >> >> Regards, >> seeyouagainbye(a)hotmail.com >> >> >> Michael Harris (MVP) wrote: >>> SeeYouAgainBye wrote: >>>> Hello, >>>> Does anyone know how to call vbe from wsf ? >>>> vbe is encoded vbscript file with screnc.exe. >>>> >>>> I make func.vbs and sample.wfs. >>>> sample.wfs code is like below. >>>> >>>> <Job id="sample1"> >>>> <Script Language="VBScript" src="func.vbs"></Script> >>>> <Script Language="VBScript"> >>>> Dim str >>>> str = func("aaa") >>>> WScript.Echo(str) >>>> </Script> >>>> </Job> >>>> >>>> The sample.wfs works as i expected. >>>> But I encode func.vbs to func.vbe, and change sample.wfs line 2 as >>>> below. >>>> >>>> <Script Language="VBScript" src="func.vbe"></Script> >>> <Script Language="VBScript.Encode" src="func.vbe"></Script> >>> >>> >>>> Then sample.wfs said error below. >>>> >>>> sample.wsf(1, 2) Microsoft VBScript compilation error: Expected >>>> statement >>>> >>>> note that screnc.exe was download from below: >>>> http://www.microsoft.com/downloads/details.aspx?FamilyID=e7877f67-c447-4873-b1b0-21f0626a6329&DisplayLang=en >>>> >>>> Regards, >>>> seeyouagainbye(a)hotmail.com > > |