473,783 Members | 2,564 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 7934
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.WaitF orExit()

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

"Tom Shelton" <to*@YOUKNOWTHE DRILLmtogden.co m> wrote in message
news:ig******** *************** ******@40tude.n et...
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.WaitF orExit()

--
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****@itsuppo rt.com.sg> wrote in message
news:OR******** ********@tk2msf tngp13.phx.gbl. ..
Hi Tom,
it raise an error:
An unhandled exception of type 'System.Invalid OperationExcept ion' occurred
in system.dll
Additional information: No process is associated with this object.

"Tom Shelton" <to*@YOUKNOWTHE DRILLmtogden.co m> wrote in message
news:ig******** *************** ******@40tude.n et...
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.WaitF orExit()

--
Tom Shelton [MVP]


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

Shelby

"Ken Tucker [MVP]" <vb***@bellsout h.net> wrote in message
news:eV******** *****@TK2MSFTNG P09.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****@itsuppo rt.com.sg> wrote in message
news:OR******** ********@tk2msf tngp13.phx.gbl. ..
Hi Tom,
it raise an error:
An unhandled exception of type 'System.Invalid OperationExcept ion' occurred in system.dll
Additional information: No process is associated with this object.

"Tom Shelton" <to*@YOUKNOWTHE DRILLmtogden.co m> wrote in message
news:ig******** *************** ******@40tude.n et...
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.WaitF orExit()

--
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
424
by: Konrad | last post by:
Hi How using VS.NET installer launch application after instalation? Thanks Konrad
1
2576
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 “Launch the application” check box. I also added custom action to “Commit” phase. Unfortunately, custom action runs earlier that the dialog box is presented (during the commit) and not at the end of installation.
0
2927
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 project, and put my application file that I want to launch in the project.However, I coudn't find any menu option that I can set something for launching the application file automatically after installation Is there any way that I can do thin one ...
2
1593
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 paste it into Microsoft Word. Then I want to double click on the diagram in Microsoft Word and have my paint program loaded with the drawing ready for editing. For this seemingly basic functionality, is there an example out there on how to do...
4
2896
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 run all from cd ... my idea is to put the bootstrapper as autorun on cd ... in MSDN i found a bootstrapper but it's for launch .msi package and not for .exe application .... thanks in advance for help .. andrew
4
20894
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 anywhere? Thanks, Joe
5
20080
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 or call external program as of different user. The problem of that design is that the mother application is still running as current user. I know that less privilege is more secure.
2
6105
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 like to be able to shell out and launch referenced applications in this way (to simplify what I'm trying to accomplish, let's say I'm trying to create a Windows Explorer like application using WinForms and C# for .NET 2.0 What's the best way to go...
4
19242
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
2625
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 box is still open. I've seen a thread that related to this but it does'nt have a solution. Hope you can give me any idea. http://bytes.com/forum/thread436556.html
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10315
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9946
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8968
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, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5379
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2877
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.