Hi!

I want to run path\prog.exe and wait to contunie with next statement in my
.vbs-file until after prog.exe has finished.
Right now the vb-script continue execution as soon as prog.exe is invoked.
Is there a way?

Ebbe

Re: Run an .exe file and wait for it to finish by heintz

heintz
Fri Feb 01 10:38:23 CST 2008

On Feb 1, 8:14=A0am, "Ebbe"
<REMOVE.CAPS.eKJFsRDX...@HGFgUYTiYFCtBGRsG.JGdJFGkGF> wrote:
> Hi!
>
> I want to run path\prog.exe and wait to contunie with next statement in my=

> .vbs-file until after prog.exe has finished.
> Right now the vb-script continue execution as soon as prog.exe is invoked.=

> Is there a way?
>
> Ebbe

You will need to add to your vbscript a function to look if the
specific .exe is still running. You can do that via WMI and VBScript.
HTH

Re: Run an .exe file and wait for it to finish by Tom

Tom
Fri Feb 01 10:59:30 CST 2008

On Feb 1, 9:14 am, "Ebbe"
<REMOVE.CAPS.eKJFsRDX...@HGFgUYTiYFCtBGRsG.JGdJFGkGF> wrote:
> Hi!
>
> I want to run path\prog.exe and wait to contunie with next statement in my
> .vbs-file until after prog.exe has finished.
> Right now the vb-script continue execution as soon as prog.exe is invoked.
> Is there a way?
>
> Ebbe

Most programs executed via the Wscript.Shells Run method, just require
the addition of a control switch to do this. Some install programs
launch other threads that circumvent this control. Since you don't
say anything about how you're running the program or what type of
program it is, I would suggest you start with adding the bWaitOnReturn
parameter to the Run statement ...

object.Run strCommand, [intWindowStyle], [bWaitOnReturn]

e.g. ...

oWSH.Run prog.exe,0, True

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

Re: Run an .exe file and wait for it to finish by Ebbe

Ebbe
Fri Feb 01 17:45:48 CST 2008

Hi Tom

Thanks
It was just what I needed :-)

Ebbe

"Tom Lavedas" <tglbatch@cox.net> skrev i en meddelelse
news:3047c434-3dab-4b9e-9a28-91e705d7e7ef@b2g2000hsg.googlegroups.com...
> On Feb 1, 9:14 am, "Ebbe"
> <REMOVE.CAPS.eKJFsRDX...@HGFgUYTiYFCtBGRsG.JGdJFGkGF> wrote:
>> Hi!
>>
>> I want to run path\prog.exe and wait to contunie with next statement in
>> my
>> .vbs-file until after prog.exe has finished.
>> Right now the vb-script continue execution as soon as prog.exe is
>> invoked.
>> Is there a way?
>>
>> Ebbe
>
> Most programs executed via the Wscript.Shells Run method, just require
> the addition of a control switch to do this. Some install programs
> launch other threads that circumvent this control. Since you don't
> say anything about how you're running the program or what type of
> program it is, I would suggest you start with adding the bWaitOnReturn
> parameter to the Run statement ...
>
> object.Run strCommand, [intWindowStyle], [bWaitOnReturn]
>
> e.g. ...
>
> oWSH.Run prog.exe,0, True
>
> Tom Lavedas
> ===========