
Shell() running asynchronously w/ VB code
Run to the site below, FAQ Library, Shell section, for 3 methods.
--=20
Randy Birch, MVP
Visual Basic
Moderator, Fidonet Visual Basic Programmer's Conference
http://home.sprynet.com/sprynet/rasanen/
VBnet, The Visual Basic Developers Resource Centre
: Hi,
:=20
: I hope someone has some insight on this function. =20
:=20
: Recently, I have noticed that the shell function (used to run an
: executable program) does not wait for the executable to finish before
: executing the next line of code. Since this function returns a value
: that lets you know if the executable ran properly or not, i am trying =
to
: trap this value to display an update message to the user. The problem
: is that this executable takes about 2 min. to finish running. =20
:=20
: How can I code it so that the VB application waits for the executable =
to
: finish before executing the next line of code?
:=20
:=20
: Here's the code i'm working with:
:=20
: Dim FTPIngramVal As Double
:=20
: FTPIngramVal =3D Shell("C:\FTP.bat")
:=20
: If FTPIngramVal =3D 0 Then =20
: MsgBox "FTP SUCCESSFUL!"
: Else
: MsgBox "FTP UNSUCCESFUL"
: End If
: