I am trying to run the following in a script
wshShell.run "\\server\updates$\PostSP3\MS03034\update\update.exe /z /u q"
wshShell.run "\\server\updates$\PostSP3\MS03039\update\update.exe /z /u /q"
however only one of the scripts runs. How do I get both of these exes to
run before exiting the script.

Carol

wshShell.run two exes in a script by Tom

Tom
Thu Sep 18 11:09:38 CDT 2003

The problem is probably caused by the second update trying
to execute while the first is running. Just a guess, but
I doubt the second will try to run in that situation. I
don't have knowledge of how these work, but if the update
requires a restart, there is just no way to get one script
to run both updates.

The first thing to try, if a restart is not required is to
add the 'wait' argument to the Run as in ...

For i = 4 to 9 step 5
wshShell.run "\\server\updates$\PostSP3\MS0303" & i _
& "\update\update.exe /z /u /q",1, TRUE
Next

This will not work, if the executable launches a new
independent thread to perform the assigned task.
Installation programs are notorious for doing this. In
such a case, you will need to find some characteristic of
the successful completion of the update and keep testing
for that state in a 'wait' loop using Wscript.Sleep
between the 'runs' to keep the second for proceeding
before the first is done.

BTW, there's a slash missing from the /q command line
switch in the first Run statement in your original posting.

Tom Lavedas
===========

>-----Original Message-----
>I am trying to run the following in a script
>wshShell.run "\\server\updates$\PostSP3\MS03034
\update\update.exe /z /u q"
>wshShell.run "\\server\updates$\PostSP3\MS03039
\update\update.exe /z /u /q"
>however only one of the scripts runs. How do I get both
of these exes to
>run before exiting the script.
>
>Carol

>

Re: wshShell.run two exes in a script by Torgeir

Torgeir
Thu Sep 18 11:11:53 CDT 2003

"News.Microsoft.com" wrote:

> I am trying to run the following in a script
> wshShell.run "\\server\updates$\PostSP3\MS03034\update\update.exe /z /u q"
> wshShell.run "\\server\updates$\PostSP3\MS03039\update\update.exe /z /u /q"
> however only one of the scripts runs. How do I get both of these exes to
> run before exiting the script.

Hi

You are running them in parallel. Change the script to run them in sequence
instead by setting the third parameter to True (bWaitOnReturn) and see if it
helps.

wshShell.run "\\server\updates$\PostSP3\MS03034\update\update.exe /z /u q", 1,
True
wshShell.run "\\server\updates$\PostSP3\MS03039\update\update.exe /z /u /q", 1,
True

Also, if you have a "On Error Resume Next" line in your script, remove it
(temporary) to avoid suppressing error messages from vbscript.


If this doesn't help, pick up the return code from the installs:

iRC1 = wshShell.run("\\server\updates$\PostSP3\MS03034\update\update.exe /z /u
q", 1, True)
iRC2 = wshShell.run("\\server\updates$\PostSP3\MS03039\update\update.exe /z /u
q", 1, True)

Wscript.Echo "Return code first installation: " & iRC1
Wscript.Echo "Return code second installation: " & iRC2


The values 0 and 3010 indicates an ok installation (3010 is "reboot needed").
Any other number indicates an failed installation.

--
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



Re: wshShell.run two exes in a script by News

News
Thu Sep 18 14:16:00 CDT 2003

Thank you Tom Lavedas and Torgeir Bakken for your replies.

I have incorporated the suggestion of running them in sequence provided by
Torgeir and my script works like a charm. Thanks again.

wshShell.run "\\server\updates$\PostSP3\MS03034\update\update.exe /z /u q",
1,
True
wshShell.run "\\server\updates$\PostSP3\MS03039\update\update.exe /z /u /q",
1,
True

"News.Microsoft.com" <cdeavy@rogers.com> wrote in message
news:ecATcNffDHA.3616@TK2MSFTNGP11.phx.gbl...
> I am trying to run the following in a script
> wshShell.run "\\server\updates$\PostSP3\MS03034\update\update.exe /z /u q"
> wshShell.run "\\server\updates$\PostSP3\MS03039\update\update.exe /z /u
/q"
> however only one of the scripts runs. How do I get both of these exes to
> run before exiting the script.
>
> Carol
>
>