473,569 Members | 2,836 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Starting 1 to n process(s) and then closing them all later when theapplication exits.

I have a application that crunches a bunch of data, creating log
files, excel files etc...
I use Process.Start to open any number of these file for viewing.

My goal is to have the application close all the file it opened when
the it exits.

I start files like this for example:
Dim myProcess As Process =
System.Diagnost ics.Process.Sta rt("LatestData. xls")

Later I try to close them like so... Myprocess.Close , however an
exception is thrown saying that the process has already exited. (?But
the file is still open?)

I later have tried
myProcess.Enabl eRaisingEvents = True
AddHandler myProcess.Exite d, AddressOf Me.ProcessExite d
myProcess.Start ("LatestData.xl s")

Friend Sub ProcessExited(B yVal sender As Object, ByVal e As
System.EventArg s)
Dim myProcess As Process = DirectCast(send er, Process)
myProcess.Close ()
End Sub

When I test this setup it seems that seconds after the file is opened
the process exits is closed.
?again the file(s) are still open?

I'm no longer sure that this is the right way to achieve my goal, or
is my implementation not correct?
Not sure...

Any suggestions anyone?




Jun 27 '08 #1
0 1089

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

Similar topics

12
2899
by: serge calderara | last post by:
Dear all, I have an application which is suppose to start another executable process. As soon as that process is running, I need to retrive its handle. The problem of the particular process I am starting is that it has a welcome window first which gets displayed and then the real windows after a while,in other words it means that the...
77
4521
by: Charles Law | last post by:
Hi guys I have a time critical process, running on a worker thread. By "time critical", I mean that certain parts of the process must be completed in a specific time frame. The time when the process starts is not especially important, but it must be complete within a small number of seconds. The operations I am performing do not take a...
3
3046
by: Timothy Shih | last post by:
Hi, I am trying to start a process from inside a .NET service. The process is a simple GUI app, the service will start up the GUI and then stop itself. The service starts the app, but no GUI appears. However, I can see the application running in the task manager. I made sure that CreateNoWindow was set to false and still no GUI appears. If...
4
3706
by: Keith H. | last post by:
I found a post on this problem from 2004, but no one at that time replied to it- I'm hoping to have better luck than the original author! As the subject states, I'm running into a problem where the msaccess.exe process does not end once a user exits a database. The author referred to a possible connection to conditional formatting, and I do...
1
9606
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej and I was wondering if anyone here would be able to give me some tips for young players such as myself, for learning the language. Is this the...
1
1675
by: dfaber | last post by:
Aloha! I want to terminate a process/program from within a python script. For example, if I have a program say foo.sh that starts running, then I can run it from within a python script using os.popen('foo.sh') which starts a program/process say 'bar' At some point later, I want to kill 'bar'. Currently, I start off the process and then...
1
1310
by: fatima.issawi | last post by:
Hello, I am trying to start a process which will zip a file using a command line utility from my webpage. I don't have any problems starting the process (on my development machine, anyway), but once the process starts, it doesn't return back to execute the rest of my code. I know it finishes. It creates the zipped file. I also checked the...
13
7339
by: Edwin Smith | last post by:
I have a form which displays a DataGridView table generated with the VS2005 tools. The database is a Pervasive v.9 with an ODBC driver. The DataGridView works great except when I'm done and I click the X to close the form the .exe refuses to die and has to be killed in Task manager. I ran a debug trace and it seems to work fine. I dropped...
8
3206
by: Lonifasiko | last post by:
Hi, Using Process class I asynchronously launch an executable (black box executable) file from my Windows application. I mean asynchronously because I've got an EventHandler for "Exited" event. Therefore, when process finishes, "Exited" event is raised. This executable writes a long file for over 1-5 minutes, and I, from my application...
0
7695
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7612
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...
0
6281
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 project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5218
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2111
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1209
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
936
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...

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.