I run a bunch of scripts on my server. Each is scheduled individually with
the sceduling service.

I'm thinking of writing one script that calls each script in turn. That
way, I will only have one entry in scheduler.

Is this possible?

Re: Calling Scripts From Script by Torgeir

Torgeir
Thu Sep 09 17:17:45 CDT 2004

Jim Bayers wrote:

> I run a bunch of scripts on my server. Each is scheduled individually with
> the sceduling service.
>
> I'm thinking of writing one script that calls each script in turn. That
> way, I will only have one entry in scheduler.
>
> Is this possible?
Hi

'--------------------8<----------------------
Set oShell = CreateObject("WScript.Shell")

' If you want them to run in parallel:
oShell.Run "wscript.exe c:\scripts\scr1.vbs", 1, False
oShell.Run "wscript.exe c:\scripts\scr2.vbs", 1, False
oShell.Run "wscript.exe c:\scripts\scr3.vbs", 1, False

' If you want script 1 to be finished before script 2 is started:
oShell.Run "wscript.exe c:\scripts\scr1.vbs", 1, True
oShell.Run "wscript.exe c:\scripts\scr2.vbs", 1, True
oShell.Run "wscript.exe c:\scripts\scr3.vbs", 1, True
'--------------------8<----------------------


Note that
oShell.Run "wscript.exe c:\scripts\scr1.vbs"

Is the same as
oShell.Run "wscript.exe c:\scripts\scr1.vbs", 1, False

because ", 1, False" is the default



WSH 5.6 documentation (local help file) can be downloaded
from here if you haven't got it already:

http://msdn.microsoft.com/downloads/list/webdev.asp




--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx

Re: Calling Scripts From Script by Eran

Eran
Fri Sep 10 01:44:45 CDT 2004

Torgeir, reading the script and then executing global won't do the trick?

"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in message
news:%23NoM5rrlEHA.536@TK2MSFTNGP11.phx.gbl...
> Jim Bayers wrote:
>
>> I run a bunch of scripts on my server. Each is scheduled individually
>> with the sceduling service.
>>
>> I'm thinking of writing one script that calls each script in turn. That
>> way, I will only have one entry in scheduler.
>>
>> Is this possible?
> Hi
>
> '--------------------8<----------------------
> Set oShell = CreateObject("WScript.Shell")
>
> ' If you want them to run in parallel:
> oShell.Run "wscript.exe c:\scripts\scr1.vbs", 1, False
> oShell.Run "wscript.exe c:\scripts\scr2.vbs", 1, False
> oShell.Run "wscript.exe c:\scripts\scr3.vbs", 1, False
>
> ' If you want script 1 to be finished before script 2 is started:
> oShell.Run "wscript.exe c:\scripts\scr1.vbs", 1, True
> oShell.Run "wscript.exe c:\scripts\scr2.vbs", 1, True
> oShell.Run "wscript.exe c:\scripts\scr3.vbs", 1, True
> '--------------------8<----------------------
>
>
> Note that
> oShell.Run "wscript.exe c:\scripts\scr1.vbs"
>
> Is the same as
> oShell.Run "wscript.exe c:\scripts\scr1.vbs", 1, False
>
> because ", 1, False" is the default
>
>
>
> WSH 5.6 documentation (local help file) can be downloaded
> from here if you haven't got it already:
>
> http://msdn.microsoft.com/downloads/list/webdev.asp
>
>
>
>
> --
> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of
> the 1328 page Scripting Guide:
> http://www.microsoft.com/technet/scriptcenter/default.mspx



Re: Calling Scripts From Script by Torgeir

Torgeir
Fri Sep 10 02:56:52 CDT 2004

Eran wrote:

> Torgeir, reading the script and then executing global won
> t do the trick?
Hi

Yes, but it has some downsides.

For different methods and some examples of code libraries and their
pros and cons, you can take a look here (my favorite is WSC):

http://groups.google.com/groups?selm=3E479EC6.6EFB4ADE%40hydro.com


Some interesting WSC links for future use maybe:

How to generate a WSC type library file automatically:
http://groups.google.com/groups?selm=3EBD6A07.C56E6B71%40hydro.com

Optional methods to reference the WSC that is not registered from a script:
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=uKQPMyT1BHA.2736%40tkmsftngp03


--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx