473,398 Members | 2,188 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Launch another application and wait for it to complete.

Hi,
if I launch another application in my vb code, how can I wait for it to
complete first?

Dim myProcess As Process
myProcess = New Process
myProcess.Start("test.exe")
' I want to wait for test to complete and continue with other codes
myProcess = Nothing

Thanks
Shelby
Nov 20 '05 #1
4 7913
On Wed, 7 Jul 2004 13:18:36 +0800, Shelby wrote:
Hi,
if I launch another application in my vb code, how can I wait for it to
complete first?

Dim myProcess As Process
myProcess = New Process
myProcess.Start("test.exe")
' I want to wait for test to complete and continue with other codes
myProcess = Nothing

Thanks
Shelby


myProcess.WaitForExit()

--
Tom Shelton [MVP]
Nov 20 '05 #2
Hi Tom,
it raise an error:
An unhandled exception of type 'System.InvalidOperationException' occurred
in system.dll
Additional information: No process is associated with this object.

"Tom Shelton" <to*@YOUKNOWTHEDRILLmtogden.com> wrote in message
news:ig*****************************@40tude.net...
On Wed, 7 Jul 2004 13:18:36 +0800, Shelby wrote:
Hi,
if I launch another application in my vb code, how can I wait for it to
complete first?

Dim myProcess As Process
myProcess = New Process
myProcess.Start("test.exe")
' I want to wait for test to complete and continue with other codes
myProcess = Nothing

Thanks
Shelby


myProcess.WaitForExit()

--
Tom Shelton [MVP]

Nov 20 '05 #3
Shelby,

You are calling waitforexit before you dispose of it? Try this.

Dim p As Process = Process.Start("Notepad.exe")

p.WaitForExit()

p = Nothing

Ken

----------------------------

"Shelby" <sh****@itsupport.com.sg> wrote in message
news:OR****************@tk2msftngp13.phx.gbl...
Hi Tom,
it raise an error:
An unhandled exception of type 'System.InvalidOperationException' occurred
in system.dll
Additional information: No process is associated with this object.

"Tom Shelton" <to*@YOUKNOWTHEDRILLmtogden.com> wrote in message
news:ig*****************************@40tude.net...
On Wed, 7 Jul 2004 13:18:36 +0800, Shelby wrote:
> Hi,
> if I launch another application in my vb code, how can I wait for it to
> complete first?
>
> Dim myProcess As Process
> myProcess = New Process
> myProcess.Start("test.exe")
> ' I want to wait for test to complete and continue with other codes
> myProcess = Nothing
>
> Thanks
> Shelby


myProcess.WaitForExit()

--
Tom Shelton [MVP]


Nov 20 '05 #4
Hi Ken,
thanks for that..

Shelby

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:eV*************@TK2MSFTNGP09.phx.gbl...
Shelby,

You are calling waitforexit before you dispose of it? Try this.
Dim p As Process = Process.Start("Notepad.exe")

p.WaitForExit()

p = Nothing

Ken

----------------------------

"Shelby" <sh****@itsupport.com.sg> wrote in message
news:OR****************@tk2msftngp13.phx.gbl...
Hi Tom,
it raise an error:
An unhandled exception of type 'System.InvalidOperationException' occurred in system.dll
Additional information: No process is associated with this object.

"Tom Shelton" <to*@YOUKNOWTHEDRILLmtogden.com> wrote in message
news:ig*****************************@40tude.net...
On Wed, 7 Jul 2004 13:18:36 +0800, Shelby wrote:

> Hi,
> if I launch another application in my vb code, how can I wait for it to > complete first?
>
> Dim myProcess As Process
> myProcess = New Process
> myProcess.Start("test.exe")
> ' I want to wait for test to complete and continue with other codes
> myProcess = Nothing
>
> Thanks
> Shelby

myProcess.WaitForExit()

--
Tom Shelton [MVP]



Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Konrad | last post by:
Hi How using VS.NET installer launch application after instalation? Thanks Konrad
1
by: Leonid Finis | last post by:
Hi, I’m trying to launch application after it was installed. I created a Windows App Deployment project. I added to “End” phase of “User Interfaces” editor a custom dialog box with...
0
by: TJ | last post by:
Dear Sir/Madam I just want to set something that application(was developed using C#) can be launched automatically after install is completed. I created Installer Project in Install and Deploy...
2
by: Peter Ignarson | last post by:
Hi there - I am writing a paint program (I am following a learning tutorial, there is no point to writing a paint program) and I want to extend it so that I can copy the contents of my drawing and...
4
by: Andrew | last post by:
hi, i'm searching for a bootstrapper that check if .net framework is installed on a machine and after the install launch my vb.net app ... i dont want to installa the app on the pc but i want to...
4
by: Joe | last post by:
I created a CustomAction for this but I don't think I have it in the right place. I tried both Install and Commit but neither allow it to get to the final screen. Are there any examples of this...
5
by: cooltoriz | last post by:
Hello there, I am not asking how to impersonate a process within C# windows application. I already know that, in C# v2.0, you can easily achieve it using ProcessStartInfo. You can run a process...
2
by: JDeats | last post by:
When a user double clicks on file item in Windows Explorer, Windows tries to open the document with whatever application is related to it's file extension. In my WinForms application I would...
4
by: EByker | last post by:
VBA for Excel contains the command Application.Wait ("time"). It does not however work in a Word application. Is there a similar command for VBA in Word? Thanks. Bertie
3
by: romcab | last post by:
Hi guys, I just want to ask your idea about launching an application automatically after installation is complete. Right now, what happen is that is automatically launched but the closed dialog...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.