Re: wScript.Shell Problems



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.

.



Relevant Pages

  • Re: Problem in calling c programs and compiling them in tcl/tk
    ... Are you using Tcl's glob command to do this? ... using exec gcc filename.c and later exec ./a.out filename.c. ... the execution of a command that might generate a Tcl error. ... i can call a c program and compile it? ...
    (comp.lang.tcl)
  • Re: xp_cmdshell default path (system32) problem
    ... exec xp_cmdshell @cmd1 ... - specify the full path in the del command ... ensure that xp_cmdshell ALWAYS executes under the security context of ... I haven't executed the actual erase statements yet but rather have been ...
    (microsoft.public.sqlserver.programming)
  • Re: Expect scripting
    ... I reverted to what I am familiar with which is script and used exec ... COMPL is the exact prompt from the remote processor? ... If the command were to be entered to the telnet session to this ... I strongly recommend you read.- Hide quoted text - ...
    (comp.lang.tcl)
  • Re: Sleep freezing
    ... >> man exec. ... > form of a standard shell pipeline where each arg becomes one ... > word of a command, and each distinct command becomes a sub- ... The word "execute" means to replace the program running in the calling ...
    (comp.unix.shell)
  • Re: Literal pipes in [open "|cmd..."]
    ... If it's not an [exec] directive, ... away with the intermediary pipe directives entirely also (or more ... As for a new command with a clean syntax, the only way you're going to ... fileevent $ou write $arg ...
    (comp.lang.tcl)