Hey folks,

Have a script with a few lines of code which are supposed to call and
execute another vb script, it doesn't. I can't see anything wrong with it.
Any thoughts?

Thanks

Function Main()

Dim strTime

strTime = "false"

While strTime = "false"
Dim Shell
Set Shell = CreateObject("WScript.Shell")
Shell.Run "%comspec% /c cscript.exe d:\Courion\ADDiscovery.vbs", 0, True
strTime = "true"
Wend

Main = DTSTaskExecResult_Success
End Function

Re: vbscript fails to execute by Evertjan

Evertjan
Tue Dec 27 13:28:46 CST 2005

=?Utf-8?B?QmFzaWxS?= wrote on 27 dec 2005 in
microsoft.public.scripting.vbscript:

> Have a script with a few lines of code which are supposed to call and
> execute another vb script, it doesn't. I can't see anything wrong
> with it. Any thoughts?
>
> Thanks
>
> Function Main()
>

A vbs fuction is only executed when called.

vbscript is NOT pascal.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Re: vbscript fails to execute by BasilR

BasilR
Tue Dec 27 21:58:01 CST 2005


--
Thank You for your response. How would you recommend calling it within from
within the same script? A simple sub procedure, say

Sub name

Call Main

End Sub

Thanks again.

"Evertjan." wrote:

> =?Utf-8?B?QmFzaWxS?= wrote on 27 dec 2005 in
> microsoft.public.scripting.vbscript:
>
> > Have a script with a few lines of code which are supposed to call and
> > execute another vb script, it doesn't. I can't see anything wrong
> > with it. Any thoughts?
> >
> > Thanks
> >
> > Function Main()
> >
>
> A vbs fuction is only executed when called.
>
> vbscript is NOT pascal.
>
> --
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)
>

Re: vbscript fails to execute by Evertjan

Evertjan
Wed Dec 28 09:00:10 CST 2005

=?Utf-8?B?QmFzaWxS?= wrote on 28 dec 2005 in
microsoft.public.scripting.vbscript:

> "Evertjan." wrote:
>
>> =?Utf-8?B?QmFzaWxS?= wrote on 27 dec 2005 in
>> microsoft.public.scripting.vbscript:
>>
>> > Have a script with a few lines of code which are supposed to call
>> > and execute another vb script, it doesn't. I can't see anything
>> > wrong with it. Any thoughts?
>> >
>> > Thanks
>> >
>> > Function Main()
>> >
>>
>> A vbs fuction is only executed when called.
>>
>> vbscript is NOT pascal.

[please do not toppost on usenet]

> Thank You for your response. How would you recommend calling it
> within from within the same script? A simple sub procedure, say
>
> Sub name
>
> Call Main
>
> End Sub

Just:

Main


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Re: vbscript fails to execute by Al

Al
Wed Dec 28 15:39:46 CST 2005


"Evertjan." <exjxw.hannivoort@interxnl.net> wrote in message
news:Xns973AA2CBB3634eejj99@194.109.133.242...
> =?Utf-8?B?QmFzaWxS?= wrote on 28 dec 2005 in
> microsoft.public.scripting.vbscript:
>
> > "Evertjan." wrote:
> >
> >> =?Utf-8?B?QmFzaWxS?= wrote on 27 dec 2005 in
> >> microsoft.public.scripting.vbscript:
> >>
> >> > Have a script with a few lines of code which are supposed to call
> >> > and execute another vb script, it doesn't. I can't see anything
> >> > wrong with it. Any thoughts?
> >> >
> >> > Thanks
> >> >
> >> > Function Main()
> >> >
> >>
> >> A vbs fuction is only executed when called.
> >>
> >> vbscript is NOT pascal.
>
> [please do not toppost on usenet]
>
> > Thank You for your response. How would you recommend calling it
> > within from within the same script? A simple sub procedure, say
> >
> > Sub name
> >
> > Call Main
> >
> > End Sub
>
> Just:
>
> Main

... or "CALL MAIN". But, and this is important, this reference to the sub
MUST be placed OUTSIDE of the sub in the script. Yes, it is possible for a
sub to call itself (see "recursion" as a programming technique), however, NO
STATEMENTS in the subroutine will be executed UNTIL the sub is actually
called. Therefore, a sub cannot "CALL ITSELF" into exectution.

/Al



Re: vbscript fails to execute by dexto

dexto
Wed Dec 28 23:37:00 CST 2005

while loop is not right i think has to be (do while strTime = "false" )
instead "Wend" has to be "loop" to end loop

and
%comspec% /c d:\Courion\ADDiscovery.vbs

no need for cscript.exe