Re: wScript.Shell Problems
- From: "Tom Lavedas" <tglbatch@xxxxxxx>
- Date: 12 Jul 2006 18:55:58 -0700
You are right that Exec does not have a boolean to cause it to wait for
the completion of the underlying process. Rather, it provides a Status
property which can be interrogated in a wait loop to determine whether
the process is still running. I say it is more versatile in that it
will allow coding of a watchdog to terminate the underlying process,
should the need arise. Not needed all the time, but it can come in
handy some times.
Having said that, I generally use the Run method with redirection when
I want access to the full output of a console process for subsequent
data extraction or error detection. However, the Exec procedure is
much better at automating a console process that may need its hand held
as it operates - say for input or to branch depending on a response or
error. I have played with automating the ftp client this way, though
I've never been completely successful with it. I stopped tinkering. A
static control script is generally sufficient and I don't do anything
with ftp that can't be done pretty easily with a one-off set of
keystrokes or via XPs instrumentation of ftp access in explorer.
Be warned however, that even console programs sometimes slip the bonds
of the Run waiting for its termination. They do this by launching a
new thread (disconnected child process) and closing the original one
that the Run executed. Your bWaitonReturn is satisfied, but the actual
guts of the procedure you launched is still churning away. Install
programs used to be notorious for this. I don't play with them much
and haven't followed this group too closely lately, so I don't know if
that's still true.
Tom Lavedas
Nico VanHaaster wrote:
I would agree with your statements and using the EXEC command has
worked well for me in the past to upload single files and I could
utilize the stdOut & stdErr commands.
Here is why i went to the RUN command, it is my understanding that the
EXEC command does not allow for the BOOLEAN indicating wether the
script should wait for the current command to be finished before moving
to the next line of the script.
I have considered creating a wscript.sleep command that sleeps for a
calculated time based on the file size.
.
- References:
- wScript.Shell Problems
- From: Nico VanHaaster
- Re: wScript.Shell Problems
- From: Nico VanHaaster
- Re: wScript.Shell Problems
- From: joseomjr@xxxxxxxxx
- Re: wScript.Shell Problems
- From: Tom Lavedas
- Re: wScript.Shell Problems
- From: Nico VanHaaster
- wScript.Shell Problems
- Prev by Date: Weird error in MID / LEFT functions
- Next by Date: Re: VBScript Writting to the Event log
- Previous by thread: Re: wScript.Shell Problems
- Next by thread: Re: wScript.Shell Problems
- Index(es):
Relevant Pages
|