Launch a program within VBS 
Author Message
 Launch a program within VBS

I would like to know if there is a way to Launch an executable file within a
vbs.

I know that with RUN method it is possible to start a process
asynchronously. But we need to start it in a synchronous way so that the
function returns control when the process is finished .

There is a particular method different from RUN or it is a parameter to
specify within RUN method itself

Thanks a lot



Fri, 06 Jun 2003 20:15:32 GMT  
 Launch a program within VBS

Quote:

> I would like to know if there is a way to Launch an executable file
> within a vbs.

> I know that with RUN method it is possible to start a process
> asynchronously. But we need to start it in a synchronous way so that
> the function returns control when the process is finished .

> There is a particular method different from RUN or it is a parameter
> tospecify within RUN method itself

> Thanks a lot

If the launched application confines itself to a single thread (or at
least the original thread remains active throughout the program's
execution), then setting the bWaitOnReturn parameter of the Run method
to True will do what you want.

Quoting from the WSH documentation:

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

Parameters

Part            Description
object          WshShell object.
strCommand      Environment variables within the strCommand parameter
                are automatically expanded.
intWindowStyle  Optional. Sets the window style of the program being
                run.
bWaitOnReturn   Optional. If bWaitOnReturn is not specified or FALSE,
                immediately returns to script execution rather than
                waiting for the process to end.

If bWaitOnReturn is set to TRUE, the Run method returns any error code
returned by the application.

If bWaitOnReturn is not specified or is FALSE, the Run method returns an
error code of 0 (zero).

Get a download of the entire online help document at:

  http://msdn.microsoft.com/scripting/windowshost/wshdoc.exe

Tom Lavedas
-----------
http://www.pressroom.com/~tglbatch/



Fri, 06 Jun 2003 21:56:53 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Help, How VBS Launch a program

2. Launching an app from within a VB program

3. Launching reports from within Delphi 5 programs

4. Execute a program that expects parameters within another program

5. Running a .vbs script from within a .vbs script

6. Launch URL within browser window using TargetFrameName?

7. Launching an executable within ASP using VBScript

8. Launch HTML page within Excel via VBScript

9. LAUNCHING/CLOSING Applications from within a VBScript

10. Launching Windows Program from DOS Program

11. Having a BASIC program launch another program

12. How to launch a VB program off the back of a non VB program

 

 
Powered by phpBB® Forum Software