Running an app with vbs 
Author Message
 Running an app with vbs

I want to run several apps in a row using a vbs script. I want the first app
to run and the second to start when the first is finished and the third when
the second is finished.....

I used the following code:

AddToLog("Installing support software...")
AddToLog("  Installing VNC")
wshShell.run "%COMSPEC% /c c:\windows\cabs\vncpack.exe",1,true
AddToLog(" ")

'***************************************************************************
***************

AddToLog("  Installing IBM Scroll Mouse")
wshShell.run "%COMSPEC% /c c:\windows\cabs\rodent.exe",1,true
msgbox "mouse " & err.number
AddToLog(" ")

'***************************************************************************
***************

AddToLog("  Installing Anti-Virus Software...")
wshShell.run "%COMSPEC% /c c:\windows\cabs\norton.exe",1,true
AddToLog(" ")

It was my understanding that when using  wshShell.run "%COMSPEC% /c
c:\windows\cabs\vncpack.exe",1,true the "true" statement at the end of the
line would make the script wait until the process was finished.

Why is it not waiting?  And how do I get around this?

Thanks.

Pierre



Sun, 01 Jun 2003 03:27:06 GMT  
 Running an app with vbs
I am under the understanding that the run command utilises the wait for
single object api call and in so doing will only wait for the parent process
to finish. I had the same problem running an installshield executable as
this spawns a child process

Correct me if I am wrong OH Knowledged ones

Paul Halse


Quote:
> I want to run several apps in a row using a vbs script. I want the first
app
> to run and the second to start when the first is finished and the third
when
> the second is finished.....

> I used the following code:

> AddToLog("Installing support software...")
> AddToLog("  Installing VNC")
> wshShell.run "%COMSPEC% /c c:\windows\cabs\vncpack.exe",1,true
> AddToLog(" ")

'***************************************************************************
Quote:
> ***************

> AddToLog("  Installing IBM Scroll Mouse")
> wshShell.run "%COMSPEC% /c c:\windows\cabs\rodent.exe",1,true
> msgbox "mouse " & err.number
> AddToLog(" ")

'***************************************************************************
Quote:
> ***************

> AddToLog("  Installing Anti-Virus Software...")
> wshShell.run "%COMSPEC% /c c:\windows\cabs\norton.exe",1,true
> AddToLog(" ")

> It was my understanding that when using  wshShell.run "%COMSPEC% /c
> c:\windows\cabs\vncpack.exe",1,true the "true" statement at the end of the
> line would make the script wait until the process was finished.

> Why is it not waiting?  And how do I get around this?

> Thanks.

> Pierre



Sun, 01 Jun 2003 04:05:26 GMT  
 Running an app with vbs
hi Pierre,

If you have wmi installed (or, are willing to download it from ms), then you
could use wmi to wait around for the secondary (child) process to launch,
then wait some more until it disappears from the process list.

Messy, but it could be made to work, jw


Quote:
> I want to run several apps in a row using a vbs script. I want the first
app
> to run and the second to start when the first is finished and the third
when
> the second is finished.....

> I used the following code:

> AddToLog("Installing support software...")
> AddToLog("  Installing VNC")
> wshShell.run "%COMSPEC% /c c:\windows\cabs\vncpack.exe",1,true
> AddToLog(" ")

'***************************************************************************
Quote:
> ***************

> AddToLog("  Installing IBM Scroll Mouse")
> wshShell.run "%COMSPEC% /c c:\windows\cabs\rodent.exe",1,true
> msgbox "mouse " & err.number
> AddToLog(" ")

'***************************************************************************
Quote:
> ***************

> AddToLog("  Installing Anti-Virus Software...")
> wshShell.run "%COMSPEC% /c c:\windows\cabs\norton.exe",1,true
> AddToLog(" ")

> It was my understanding that when using  wshShell.run "%COMSPEC% /c
> c:\windows\cabs\vncpack.exe",1,true the "true" statement at the end of the
> line would make the script wait until the process was finished.

> Why is it not waiting?  And how do I get around this?

> Thanks.

> Pierre



Mon, 02 Jun 2003 03:29:03 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. running external apps via a vbs script.

2. stop app, run script, restart app

3. Running a .vbs script from within a .vbs script

4. Calling *.vbs files to Run From Master VBS File

5. running DOS PROgram from VB APP using variables in the app

6. Warning message when creating Excel object from Vb App when app is running as a service

7. How to get a list of running apps and How to close down apps

8. CAB questions: 1) run app after install 2) installed multiple apps

9. Run VB app directly from CD without running setup

10. Want to kill an app in a .vbs

11. launch vbs script from a hta app?

12. Uninstall apps using VBS

 

 
Powered by phpBB® Forum Software