Letting one prosess be done before starting the next one 
Author Message
 Letting one prosess be done before starting the next one

I have to prosesses i run with the WScript.Shell - Run (command). This will
start a command shell and excecute the command entered. The second command
is not suppose to start until the first one's command-shell is closed
(finnished).
What happens now is that the second will start as soon as the first one
returns from starting the command-shell (but the shell has not finnished)

Is there a way to check if the command-shell is finnished?? Or at least make
the script hold for 10 sec????

-------------------
1 var ws = new ActiveXObject("WScript.Shell");

3

control=d:\\bat\\bad\\test_loader.ctl");
------------------

Any help here would be amensly appreciated

FinnA



Fri, 26 Sep 2003 19:49:50 GMT  
 Letting one prosess be done before starting the next one

Quote:

> I have to prosesses i run with the WScript.Shell - Run (command).
> This will start a command shell and excecute the command entered.
> The second command is not suppose to start until the first one's
> command-shell is closed (finished).
> What happens now is that the second will start as soon as the first
> one returns from starting the command-shell (but the shell has not
> finished)

> Is there a way to check if the command-shell is finished?? Or at
> least make the script hold for 10 sec????

> -------------------
> 1 var ws = new ActiveXObject("WScript.Shell");

> 3

> control=d:\\bat\\bad\\test_loader.ctl");
> ------------------

> Any help here would be amensly appreciated

> FinnA

Unless the secondary process is one that launches additional threads,
such as an installation program, setting Run method's bWaitForReturn
(third) parameter to True is all you need.  See the WSH documentation
for more information:

Documentation (compiled html download)

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

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



Fri, 26 Sep 2003 20:47:25 GMT  
 Letting one prosess be done before starting the next one
WSH Documentation
http://msdn.microsoft.com/scripting/windowshost/docs/reference/defaul...
http://msdn.microsoft.com/scripting/windowshost/wshdoc.exe

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

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

=-=-=
Steve
-=-=-


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

Quote:
> I have to prosesses i run with the WScript.Shell - Run (command). This
will
> start a command shell and excecute the command entered. The second command
> is not suppose to start until the first one's command-shell is closed
> (finnished).
> What happens now is that the second will start as soon as the first one
> returns from starting the command-shell (but the shell has not finnished)

> Is there a way to check if the command-shell is finnished?? Or at least
make
> the script hold for 10 sec????

> -------------------
> 1 var ws = new ActiveXObject("WScript.Shell");

> 3

> control=d:\\bat\\bad\\test_loader.ctl");
> ------------------

> Any help here would be amensly appreciated

> FinnA



Fri, 26 Sep 2003 20:42:18 GMT  
 Letting one prosess be done before starting the next one
Thanks. I have used js and vbs - helpfiles, didnt know about the wsh-help.
It did the trick. One comment on the example though. It says Run(....., 1,
TRUE) - allthough it's supposed to be "TRUE" (stringed)

Again, thanks

FinnA



Sat, 27 Sep 2003 15:35:34 GMT  
 Letting one prosess be done before starting the next one

Quote:

> Thanks. I have used js and vbs - helpfiles, didnt know about the wsh-help.
> It did the trick. One comment on the example though. It says Run(....., 1,
> TRUE) - allthough it's supposed to be "TRUE" (stringed)

> Again, thanks

> FinnA

No, True is a predefined constant (equal to -1) as is False (equal to
zero).  I am surprised that "True" works.

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



Sat, 27 Sep 2003 20:35:41 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. How to let Mediaplayer play MP3 files next by next

2. No one has gotten back to me on this yet so I am reposting

3. ASP : Passing values from One ASP to the Next

4. Multiple PS files to one, one-page PS

5. one file->one image

6. splitting one big (~500 pages) ps file into small-ones - with delimiters in files

7. writing more than one vbscript statement in one line

8. ONE PS and ONE PDF Question.

9. Refreshing one frame when another one changes.

10. Merging multiple documents into one multi-page one

11. Merge more than one binary file into one.

12. Find more than one elements by one class name

 

 
Powered by phpBB® Forum Software