473,406 Members | 2,707 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,406 software developers and data experts.

How t oKill a Process which is started by Process.Start in C#.NET

Hi ,
I want to Kill a Process Which is Started by the Process.Start() Method.

I create one MDI Form and on MDI Form's MenuItem i write the Code.

The Problem is that whwn i Close The MDI Form then the Process Which is
Started By Process.Start() is Still Running.


Bellow is the Code.


private void calculatorToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{

myProcess = Process.Start("calc.exe");
}
catch (Exception e1)
{
MessageBox.Show("Error:"+e1.Message);

}
}
GIve me the Code to Kill The Process Please.
Oct 19 '07 #1
2 1227
debasisdas
8,127 Expert 4TB
Question moved to .NET Forum.
Oct 19 '07 #2
Plater
7,872 Expert 4TB
In your situation:
Expand|Select|Wrap|Line Numbers
  1. myProcess.Kill();
  2.  
Oct 19 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

12
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...
3
by: Manfred Braun | last post by:
Hi All, the Process.Start method returns a boolean value to indicate, if a process was started or not. Where can I obtain more detailed error information, if the process could not be started ???...
3
by: Nikolay Petrov | last post by:
I have a class which starts a process and redirects it's output and input. My class have a method which starts the process and another which stops it. How can I check if the process have been...
7
by: Phil Mc | last post by:
Hi all I have a small scheduling application that I have written which will be running on a Windows 2003 server. This application is started at different times by an 'autosys' job (though I am...
4
by: Paul | last post by:
Hi, I am trying to start a process hidden. My code: wordprocess = new System.Diagnostics.Process(); ; wordprocess.StartInfo = new System.Diagnostics.ProcessStartInfo(wcmd, args);...
11
by: Jon Davis | last post by:
Does anyone know why using System.Diagnostics.Process to "wrap" a console application does not always transmit the I/O, depending on what processes you're trying to "consume"? PowerShell, for...
0
by: =?Utf-8?B?Um9i?= | last post by:
I've a requirement to monitor when certain applications are started. I'm using WMI called from VS Stusio 2005 in VB to trap Excel and Word starting. I've written the following console application...
2
by: Dax | last post by:
Does anyone know if there's a means by which I can invoke a Process.Start, then detach the process from the calling process. I suppose in a nutshell I'm asking if there's a way I can add the new...
3
by: Bali | last post by:
Hi I have an ASP.NET application. I am on the server side and trying to start an application which is on the server. The process gets started(can be seen in the Task Manager) but doesn't do...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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 project—planning, 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.