Searching \ for '[OT]: Shelling in VB' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=shelling
Search entire site for: 'Shelling in VB'.

Exact match. Not showing close matches.
PICList Thread
'[OT]: Shelling in VB'
2001\04\06@134732 by Sean Breheny

face picon face
Hi everyone,

Once again, I have a Visual Basic question and you are the most
knowledgeable group I know on this subject.

I'm trying to run an external program from a VB program (the external
program is actually XXCOPY, as mentioned on this list not long ago,
because I am using it for backing stuff up over a network). It is working
well except that I can't find a way to make it wait for the first process
to finish before spawning a new one (so, if I want to sequentially call
XXCOPY 10 times, I instead get 10 copies running simultaneously).

I could probaby do some kind of trick where I have XXCOP log it's output
to a file and then keep checking the file for the last line to be
written, but I thought that possibly VB would have a built-in way of
doing this (I'm currently using the SHELL command and that appears to not
have any option like this).

Thanks,

Sean

--
http://www.piclist.com hint: To leave the PICList
spam_OUTpiclist-unsubscribe-requestTakeThisOuTspammitvma.mit.edu


2001\04\06@174629 by Craig Tucker

flavicon
face
I have used this code before to do something similar before...

If you go to: http://www.mvps.org/vb/ and look in the Samples area for
'Shell32.zip', it has a library with several methods to call and wait for
applications to shell, etc.

Hope that helps.

-Craig Tucker





{Original Message removed}

2001\04\07@043812 by Peter L. Peres

picon face
I think that you are looking for locking. Locking can be done by writing a
temporary file f.ex. and checking that file's presence. If it is present,
the command is likely running. This is not foolproof because the access
should be atomic (between checking whether the files exists and creating
it). A better approach uses a variable in your program that is checked
before each shell is spawned. The variable needs to be global and
'volatile' in the C sense of the word (and you still need to make sure
access is atomic). I don't know how to do that in VB.

There is an elaborate scheme using two flags to attain atomic manipulation
of the second flag when you cannot guarantee atomicity otherwise (by
disabling interrupts).

Peter

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\04\07@094444 by Craig Tucker

flavicon
face
I have used this code before to do something similar before...

If you go to: http://www.mvps.org/vb/ and look in the Samples area for
'Shell32.zip', it has a library with several methods to call and wait for
applications to shell, etc.

Hope that helps.

-Craig Tucker





{Original Message removed}

2001\04\10@045146 by P.J. McCauley

picon face
Sean,

Check out http://www.planetsourcecode.com It's in there somewhere. If you
can't find it let me know and I'll see if I can dig it out of one of my
programs.

Joe

{Original Message removed}

2001\04\18@180602 by Sean H. Breheny

face picon face
Thanks to all those who responded about this, I will check out your
suggestions.

Sean

At 09:50 AM 4/10/01 +0100, you wrote:
>Sean,
>
>Check out http://www.planetsourcecode.com It's in there somewhere. If you
>can't find it let me know and I'll see if I can dig it out of one of my
>programs.
>
>Joe

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


More... (looser matching)
- Last day of these posts
- In 2001 , 2002 only
- Today
- New search...